<configuration>
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler,
log4net-net-1.0"
/>
</configSections>
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="ReflectionLayout" />
</root>
<appender name="ReflectionLayout" type="log4net.Appender.FileAppender" >
<param name ="StaticLogFileName" value ="False" />
<file type="log4net.Util.PatternString" value="C:/Log/%date{yyyy-MM-dd}.log"></file> //参数化
<param name="RollingStyle" value="Date" />
<prarm name="MaximumFileSize" value="10MB"/>
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d %n %m %n" />//日志格式
</layout>
</appender>
</log4net>