logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Richardson <RDRichard...@rad-con.com>
Subject Two logs have the same appenders
Date Fri, 03 Oct 2014 20:45:44 GMT
I want to get two independent sets of appender objects from the same configuration file, so
that I can use different file names in a FileAppender, for example.  But the standard way
of getting appender objects is to use the LogManager object, which is static.  Since there's
only one LogManager, it will always return the same set of appender objects.  So, I get one
ILog object, get its FileAppender object, set its file name, and write a message, and it appears
in the expected file.  Then, I get another ILog object, get the FileAppender object,  set
its file name to some other file, and write a message, and that message appears in the second
file.  Finally, I go back to the first file appender, write another message, and it appears
in the second appenders file.  

Is there a way to copy a FileAppender object, or to get a new object for the same appender
name out of the LogManager?

Thanks very much!

RobR, who will probably have to just build the logger programmatically instead of using a
configuration file
Mime
View raw message