从 log4net 生成相同的文件
Generate identical files from log4net
Similar question to here but slightly different
如所附的 link 我正在尝试让 log4net 输出到多个 (x2) 文件。
与 link 相反,我希望将相同的信息发送到两个文件。由于某种原因,只生成第一个日志文件 (Logs.log) 而不是第二个 (LogsTest.log)
有人可以帮我解释一下吗?
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Logs.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<threshold value="INFO" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="INFO" />
<levelMax value="OFF" />
</filter>
<maxSizeRollBackups value="30" />
<maximumFileSize value="50MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger %P{url} %P{usr} %P{addr} – %message%newline" />
</layout>
</appender>
<appender name="RollingFileAppender1" type="log4net.Appender.RollingFileAppender">
<file value="LogsTest.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<threshold value="INFO" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="INFO" />
<levelMax value="OFF" />
</filter>
<maxSizeRollBackups value="30" />
<maximumFileSize value="50MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger %P{url} %P{usr} %P{addr} – %message%newline" />
</layout>
</appender>
<logger name="PlaceGen">
<level value="ALL" />
<appender-ref ref="RollingFileAppender" />
<appender-ref ref="RollingFileAppender1" />
</logger>
</log4net>
让本地运营商先重启应用程序会很聪明
Similar question to here but slightly different
如所附的 link 我正在尝试让 log4net 输出到多个 (x2) 文件。 与 link 相反,我希望将相同的信息发送到两个文件。由于某种原因,只生成第一个日志文件 (Logs.log) 而不是第二个 (LogsTest.log)
有人可以帮我解释一下吗?
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Logs.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<threshold value="INFO" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="INFO" />
<levelMax value="OFF" />
</filter>
<maxSizeRollBackups value="30" />
<maximumFileSize value="50MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger %P{url} %P{usr} %P{addr} – %message%newline" />
</layout>
</appender>
<appender name="RollingFileAppender1" type="log4net.Appender.RollingFileAppender">
<file value="LogsTest.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<threshold value="INFO" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="INFO" />
<levelMax value="OFF" />
</filter>
<maxSizeRollBackups value="30" />
<maximumFileSize value="50MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger %P{url} %P{usr} %P{addr} – %message%newline" />
</layout>
</appender>
<logger name="PlaceGen">
<level value="ALL" />
<appender-ref ref="RollingFileAppender" />
<appender-ref ref="RollingFileAppender1" />
</logger>
</log4net>
让本地运营商先重启应用程序会很聪明