How do I create a new file for each log4net logger instance? -
i trying create different log file each thread (the threads handling site processing). naming log file name derived site being processed.
i know globalcontext.properties , theadcontext.properties , neither seem work trying do. in pretty either case concurrently running threads use whichever file current output file output. difference have seen if use threadcontext set property makes files outputs one, using global seems make 1 file unless processes start @ different times.
what able tell file use name of logger object (the name used in instantiating object) in file name instead of using these properties.
instead of fighting configuration, recommend rethink logging strategy. log4net not built log file per thread/class. loggers created @ startup or on first write (depends). use tailing log file reader, kiwi log viewer or splunk, , filter on thread id or logger name in messages.
if put them in conversion pattern...
<conversionpattern value="%date [%thread] %-5level %logger: %message%newline" />
Comments
Post a Comment