multi log4net instances using different configurations from the same config file -
i writing application require 2 different loggers, each logging in totally different way. when create each instance of log4net logger how can read own config section within same app.config file. possible have seen far taking default
you can log 2 or more things independently without using separate config files.
logmanager.getlogger("log1") logmanager.getlogger("log2")
then in config file can create them this
<logger name="log1" additivity="false"> <level value="info" /> <appender-ref ref="logfileappender1" /> </logger> <logger name="log2" additivity="false"> <level value="info" /> <appender-ref ref="logfileappender2" /> </logger>
by selecting additivity false log separately. can populate appenders write info needed.
Comments
Post a Comment