I'm setting up log4net and want to write debug messages in "debug.log", info messages in "info.log" and so on.
To this end, I use several appenders, such as:
<appender name="DebugLogger" type="log4net.Appender.RollingFileAppender">
<file value="..\Logs\Debug.log" />
<threshold value="DEBUG" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
and similar ones for INFO, WARN and ERROR levels. This works ok, but seems like a lot of extra work, because all those appenders differ only on threshold value (debug or warn etc) and file name (debug.log or warn.log etc)
Is there any better way to achieve my goal? Maybe something like declaring "base appenders" first.
(on a separate note - if that's not possible in log4net but possible in NLog, I'd be grateful to know as well)
Thanks!