Skip to content

Instantly share code, notes, and snippets.

@timothyshort
Last active September 14, 2017 00:04
Show Gist options
  • Save timothyshort/bf216fd0f7f3212fe133ea8197f54cdc to your computer and use it in GitHub Desktop.
Save timothyshort/bf216fd0f7f3212fe133ea8197f54cdc to your computer and use it in GitHub Desktop.
This is an XML configuration file for log4.net with App.config for C#.NET framework in Visual Studio
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net debug="false">
<appender name="LogFileAppender" type="log4net.Appender.FileAppender,log4net">
<!-- Modify this value to define the location and name of log file -->
<param name="File" value="C:\Desktopt\TestLog.log"/>
<param name="AppendtoFile" value="true"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<!-- Modify the value to define the apperance of the log message -->
<param name="ConversionPattern" value="%date %level %logger - %message%newline"/>
</layout>
</appender>
<root>
<priority value="ALL"/>
<appender-ref ref="LogFileAppender"/>
</root>
<category name="Test Framework">
<priority value="ALL"/>
</category>
</log4net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment