I don't mind Jaroslaw posting here. I think there's plenty of room in the log world for 2 well designed loggers.
I thought Nicko's reply was a bit complicated. I think all the user need ed to do was put something in the MDC to differenciate log requests during post-processing. That's just one line of code in both NLog and Log4Net. --- Hollywood <[EMAIL PROTECTED]> wrote: > This is the Log4NET mailing list, why is NLog being mentioned here? > If > I'm interested in NLog and how to configure it, I'd subscribe to the > appropriate listing! > > -----Original Message----- > From: Jaroslaw Kowalski [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 12, 2005 12:30 PM > To: Log4NET User > Subject: Re: Multiple Log files > > NLog (http://nlog.sourceforge.net) can do it quite easily and it's 10 > lines > of config code. > > I'm attaching a fully working configuration for NLog that does > advanced > log > routing > (taken unmodified from an actual server configuration). > > In this example, each log goes into 3 file groups: > > 1. Per-user log, separated by year,month,day and user login: > > logs/userlog/yyyy/MM/dd/yyyy-MM-dd.LOGIN.log > > 2. Per-request log - each HTTP request goes into its own file (0.log, > 1.log, > 2.log, ...) year,month,day: > > logs/requestlog/yyyy/MM/dd/yyyy-MM-dd.COUNTER.log > > 3. warnings and errors for each day go to: > > logs/yyyy-MM-dd.warnerror.log > > To use it, just put NLog.dll in your web "bin" directory and web.nlog > next > to web.config. That's all. No other configuration is necessary. > > As you can see, using layouts to specify file names can be pretty > powerful > technique. I found that I don't need any form of rolling appenders, > because > layouts give me much more. Specifying date/time as part of the > filename > layout can make your logging really productive. > > Jarek > > ----- Original Message ----- > From: "Nicko Cadell" <[EMAIL PROTECTED]> > To: "Log4NET User" <[email protected]> > Sent: Wednesday, May 11, 2005 10:13 PM > Subject: RE: Multiple Log files > > > > Having an log file for the server should be simple enough. It > should > be > > a FileAppender or RollingFileAppender configured as per > > > http://logging.apache.org/log4net/release/config-examples.html#fileappen > > der > > If you want to log everything or just certain code namespaces to > this > > file then that should be reflected in the <logger> config. > > > > When you say you want a separate file per client, do you know in > advance > > all the clients? Or are there an unlimited number of potential > clients? > > Log4net does not currently have any support for a multiplexing > appender, > > i.e. an appender that selectively routes to a potentially large set > of > > subappenders, and also has the ability to create these appenders. > Do > you > > want the client's log file to be held open once the client logs in, > or > > should the files be opened and closed per message? > > > > It should be possible to extend the FileAppender to use a > PatternLayout > > against the current LoggingEvent to generate the output filename on > a > > per event basis, the file could be cached open until the filename > > changes, in that scenario you could set the client ID on the > > ThreadContext.Properties and use that to switch the output > filenames. > > > > If the appender ends up rapidly switching between different log > files > > then the processor overhead may be high, but that depends on your > > situation. > > > > Depending on your requirements it may be easiest to write a new > appender > > from scratch to support your one file per client scenario. > > > > Cheers, > > > > Nicko > > > >> -----Original Message----- > >> From: Shrivastava, Ravi > [mailto:[EMAIL PROTECTED] > >> Sent: 11 May 2005 15:18 > >> To: Log4NET User > >> Subject: Multiple Log files > >> > >> I am trying to use Log4Net in a server enviroment. I would > >> like to have the following features: > >> > >> 1. One log file for the server > >> 2. Individual log files for every client that logs in. > >> > >> As the clients will be running in the same process/memory > >> space (of the server) - how do I configure Log4Net to do 1 & > >> 2? Any help will be greatly appreciated. > >> > >> -- RS. > >> > >> > >> > >> > > > > >
