Permalink
Browse files

Moved log4net config from app.config to log4net.xml and updated the b…

…inaries in the lib folder of SampleApplicationUsingExcelMapper
  • Loading branch information...
1 parent fc45d9a commit 332072bbf44feeeffb9aca940dbc738c9d77b06e @shashankshetty shashankshetty committed Jul 2, 2009
View
@@ -26,17 +26,18 @@
<echo message="Copying artifacts to build directory"/>
<copy todir="${build.dir}" overwrite="true">
- <fileset basedir="src\RunTimeCodeGenerator\bin">
+ <fileset basedir="src\RunTimeCodeGenerator\bin\Debug">
<include name="*.*" />
- </fileset>
+
+ </fileset>
</copy>
<copy todir="${build.dir}" overwrite="true">
- <fileset basedir="src\ExcelMapper\bin\x86">
+ <fileset basedir="src\ExcelMapper\bin\x86\Debug">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${build.dir}" overwrite="true">
- <fileset basedir="src\BuildDTOsFromExcel\bin">
+ <fileset basedir="src\BuildDTOsFromExcel\bin\Debug">
<include name="*.*" />
</fileset>
</copy>
@@ -56,7 +57,7 @@
<copy todir="${build.dir}" overwrite="true">
<fileset basedir="src\BuildDTOsFromExcel.Tests\bin\Debug">
<include name="*" />
- <include name="**\*.*" />
+ <include name="**\*.*" />
</fileset>
</copy>
</target>
@@ -83,7 +83,6 @@
</Content>
</ItemGroup>
<ItemGroup>
- <None Include="App.config" />
<None Include="TestDirectory\Users.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
- </configSections>
- <log4net>
- <appender name="Console" type="log4net.Appender.ConsoleAppender">
- <layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="%5level [%thread](%file:%line) - %message%newline" />
- </layout>
- </appender>
- <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
- <file value="Logs/RunTimeCodeGenerator.log" />
- <appendToFile value="true" />
- <maximumFileSize value="1000KB" />
- <maxSizeRollBackups value="10" />
- <layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="%date %level %thread %logger - %message%newline" />
- </layout>
- </appender>
- <root>
- <level value="WARN" />
- <!-- OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL -->
- <appender-ref ref="Console" />
- <appender-ref ref="RollingFile" />
- </root>
- </log4net>
-</configuration>
@@ -93,7 +93,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <None Include="App.config" />
<None Include="Excel\Users.xls">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
- </configSections>
- <log4net>
- <appender name="Console" type="log4net.Appender.ConsoleAppender">
- <layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="%5level [%thread](%file:%line) - %message%newline" />
- </layout>
- </appender>
- <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
- <file value="Logs/RunTimeCodeGenerator.log" />
- <appendToFile value="true" />
- <maximumFileSize value="1000KB" />
- <maxSizeRollBackups value="10" />
- <layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="%date %level %thread %logger - %message%newline" />
- </layout>
- </appender>
- <root>
- <level value="WARN" />
- <!-- OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL -->
- <appender-ref ref="Console" />
- <appender-ref ref="RollingFile" />
- </root>
- </log4net>
-</configuration>
@@ -66,7 +66,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <None Include="App.config" />
<None Include="ClassGeneration\ClassWithMethods.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -1,5 +1,6 @@
using System.CodeDom.Compiler;
using System.Collections.Generic;
+using System.IO;
using log4net;
using log4net.Config;
@@ -14,7 +15,7 @@ public class AssemblyGenerator : IAssemblyGenerator
public AssemblyGenerator()
{
- XmlConfigurator.Configure();
+ XmlConfigurator.Configure(new FileInfo("log4net.xml"));
}
public bool Compile(string[] classNames, AssemblyAttributes assemblyAttributes)
@@ -43,6 +43,8 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
@@ -70,7 +72,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <None Include="App.config" />
+ <Content Include="log4net.xml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -1,9 +1,5 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
- </configSections>
- <log4net>
+<?xml version="1.0" encoding="utf-8" ?>
+<log4net>
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%5level [%thread](%file:%line) - %message%newline" />
@@ -24,5 +20,4 @@
<appender-ref ref="Console" />
<appender-ref ref="RollingFile" />
</root>
- </log4net>
-</configuration>
+</log4net>
@@ -1,9 +1,5 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
- </configSections>
- <log4net>
+<?xml version="1.0" encoding="utf-8" ?>
+<log4net>
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%5level [%thread](%file:%line) - %message%newline" />
@@ -13,7 +9,7 @@
<file value="Logs/RunTimeCodeGenerator.log" />
<appendToFile value="true" />
<maximumFileSize value="1000KB" />
- <maxSizeRollBackups value="10" />
+ <maxSizeRollBackups value="10" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
@@ -24,5 +20,4 @@
<appender-ref ref="Console" />
<appender-ref ref="RollingFile" />
</root>
- </log4net>
-</configuration>
+</log4net>

0 comments on commit 332072b

Please sign in to comment.