|
Here is how to add a single log statement
to an application: Add this line at the top of the file
containing the method you want to add logging to: using log4net; Add this line in the “global”
area of the class in that file, say right after: namespace SomeClass { public
class SomeClass: System.Web.UI.Page { Add this line: private
static readonly ILog log = LogManager.GetLogger("Logger" ); Then inside a method add: private
void Page_Load(object sender, System.EventArgs e) { log.Debug("debugging
" + this.Trace); You need to add a line to AssemblyInfo.cs: [assembly:
log4net.Config.DOMConfigurator()] and add a reference to the log4l.dll
(right-click the project and select it) – this is outlined on the website
below. I think that’s it – you could
log your head off at this point I think. Only 3 lines harder than
System.Console.writeline() I think … Thanks, Owen Corpening Acorn Systems From: Hart, Leo
[mailto:[EMAIL PROTECTED] Have you seen this walkthrough? It was enough to get me started, though I
did need to do some additional research as far as configuration files go.
If you have a specific question, like "How do I get my web app to
recognize log4net or something, just ask." I'll do my best to
provide you with an answer, as will others on this list.
|
Title: Message
- Log4Net only for the committed techies David Anderson
- Re: Log4Net only for the committed techies Oliver Sturm
- RE: Log4Net only for the committed techies Hart, Leo
- Re: Log4Net only for the committed techies Owen Corpening
- Re: Log4Net only for the committed techies Ron Grabowski
- RE: Log4Net only for the committed techies Hart, Leo
- RE: Log4Net only for the committed techies Ron Grabowski
- RE: Log4Net only for the committed techies Hart, Leo
- Re: Log4Net only for the committed techies Jaroslaw Kowalski
- RE: Log4Net only for the committed techies Dag Christensen
- RE: Log4Net only for the committed techies Marc Lewandowski
