A standard configuration of Log4Net for a EPiServer CMS 5 installation.
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<appender name="fileLogAppender" type="log4net.Appender.FileAppender" >
<!-- The path is relative to the application base, i.e. the EPiServerSample directory. ASP.NET Machine Account must have modify rights there.
You probably do NOT want to place it in the application base directory, as it is potentially avaialable to Web site vistors.
DO CHANGE THE LOCATION BELOW FOR PRODUCTION SYSTEMS -->
<file value="EPiServerErrorLog.txt" />
<!-- Typical encoding values are Unicode/utf-16 or utf-8 or ascii. See System.Text.Encoding for more info. Omit this tag to get the system default Ansi -->
<!-- Use utf-8 for the file appender to conform to EPiServer practices and reduce log file size -->
<encoding value="utf-8" />
<lockingModel value="MinimalLock" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<!-- You should be aware that generating type and method information is very SLOW -->
<conversionPattern value="%date %level [%thread] %type.%method - %message%n" />
</layout>
</appender>
<!-- Try the logview4net utility to listen to UDP-logs, download from sourceforge.net -->
<appender name="udpLogAppender" type="log4net.Appender.UdpAppender" >
<!-- Typical encoding values are Unicode/utf-16 or utf-8 or ascii. See System.Text.Encoding for more info. Omit this tag to get the system default Ansi -->
<!-- Use utf-16 since it's default for logvivew4net -->
<encoding value="utf-16" />
<!-- Be careful where you send the logs, they may contain sensitive data. You can use 224.0.0.1 for the local net -->
<remoteAddress value="127.0.0.1" />
<remotePort value="8080" />
<layout type="log4net.Layout.PatternLayout">
<!-- You should be aware that generating type and method information is very SLOW -->
<conversionPattern value="%date %level [%thread] %type.%method - %message%n%exception" />
</layout>
</appender>
<!-- The RollingFileAppender will create new files according to the settings, typically once every day for example -->
<appender name="fileStatisticsAppender" type="log4net.Appender.RollingFileAppender">
<!-- The path is relative to the application base, i.e. the EPiServerSample directory. ASP.NET Machine Account must have modify rights there.
You probably do NOT want to place it in the application base directory, as it is potentially avaialable to Web site vistors.
DO CHANGE THE LOCATION BELOW FOR PRODUCTION SYSTEMS -->
<file value="EPiServerStatisticsLog.txt" />
<!-- Typical encoding values are Unicode/utf-16 or utf-8 or ascii. See System.Text.Encoding for more info. Omit this tag to get the system default Ansi -->
<!-- use ASCII to make it easy for other programs to interpret the contents of the statistics log -->
<encoding value="ascii" />
<lockingModel value="MinimalLock" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<layout type="log4net.Layout.PatternLayout">
<!-- You should be aware that generating type and method information is very SLOW -->
<param name="ConversionPattern" value="%date|%message%n" />
</layout>
</appender>
<!-- Statistics are sent to this logger, when enabled -->
<logger name="EPiServer.Diagnostics.StatisticsLog">
<!-- Statistics are sent as 'Info' level logs, set the level to "All" to enable logging, "Off" to disable statistics logging -->
<level value="Off" />
<appender-ref ref="fileStatisticsAppender" />
</logger>
<!-- Error and general program flow logs are sent to the root logger. Note that all logs, including statistics if enabled,
will be sent to these appenders as well -->
<root>
<!-- You can use levels, in increasing order of verbosity: Off, Fatal, Error, Warn, Info, Debug, All -->
<level value="Warn" />
<!-- Uncomment one or all of the appender-ref's, or add additional ones -->
<!-- appender-ref ref="fileLogAppender" / -->
<!-- LogView4net is a good application to use to listen to logging output via UDP. Find it on sourceforge. -->
<appender-ref ref="udpLogAppender" />
</root>
</log4net>