You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "Lyons, Allen" <Al...@turner.com> on 2004/09/27 19:55:00 UTC

HttpContext logging

Hi,

I have a web application that I would like to convert to log4net. Currently, when I get an exception I log it to my own custom classes which create a few strings with a dump the HttpContext Request, Session and Server Variables. Then along with the exception, it logs this info to a table within my database. I know I can use the ADONetAppender to take care of the database part, but how and when can I get log4net to collect the rest of the information.

Is the best way to do this to create my own custom layout class that returns this information? Does the custom layout get created when the message is logged or when it is finally sent to an appender? Since HttpContext is thread sensitive, what would I have to keep in mind about the threading that goes on behind the scenes in log4net?

TIA,
Allen Lyons 
Web Application Developer
TBS Enterprise Applications