在本地机器 log4net 写入事件日志,在服务器上它只创建文件但它不写它。
它不能是权限,因为它会创建文件......
有什么建议吗?
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationS``ectionHandler,log4net"/>
<section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord"/>
</configSections>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\Logs\Services"/>
<appendToFile value="true"/>
<staticLogFileName value="false"/>
<rollingStyle value="Composite"/>
<datePattern value="yyyyMMdd.lo\g"/>
<maxSizeRollBackups value="5"/>
<maximumFileSize value="100MB"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%newline %date [%thread] %-5level %logger - %message%newline"/>
</layout>
</appender>
<root>
<!-- priority value can be set to ALL|INFO|WARN|ERROR -->
<level value="ALL"/>
<appender-ref ref="RollingLogFileAppender"/>
</root>
</log4net>
编辑:我可以给你更多信息
在 LOG4NET 的 DEBUG MODE 上它写在服务器上,我可以看到所有的 DEBUG LOG
并以这些行结束
log4net: Type = [3], r0 = [19700101.log], r1 = [19700102.log]
log4net: curSizeRollBackups starts at [0]
log4net: reated Appender [RollingLogFileAppender]
log4net: Adding appender named [RollingLogFileAppender] to logger [root]
log4net: Hierarchy Threshold []
log4net: Shutdown called on Hierarchy [log4net-default-repository]