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. > > > >
