Last active
December 24, 2015 00:29
-
-
Save jeremykdev/6717125 to your computer and use it in GitHub Desktop.
Log4Net configuration for a rolling file appender with a new file each day.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<log4net> | |
<appender name="rollFile" type="log4net.Appender.RollingFileAppender"> | |
<file value="C:\path\log" /> | |
<rollingStyle value="Date" /> | |
<datePattern value="yyyy-MM-dd'.txt'" /> <!-- added .txt to end of date pattern so that the file extension txt will be used, note that .txt is escaped by single quotes --> | |
<appendToFile value="true" /> | |
<staticLogFileName value="false" /> | |
<layout type="log4net.Layout.PatternLayout"> | |
<!-- note that 	 is tab --> | |
<!-- tab must be specified with XML escape characters --> | |
<conversionPattern value="%date{yyyy-MM-dd HH:mm:ss:fff}	%level	%message	%exception%newline" /> | |
</layout> | |
</appender> | |
<root> | |
<!-- log DEBUG level and above--> | |
<level value="DEBUG" /> | |
<!-- reference the configured appenders to write log entries to --> | |
<appender-ref ref="rollFile" /> | |
</root> | |
</log4net> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment