logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chase Rogers" <crog...@nextit.com>
Subject trying somthing simple, and it fails
Date Fri, 17 Dec 2004 22:06:54 GMT
All I am trying to do is make a fileAppender.  
I just want to know how to use the log4net tool, but the documentation
does'nt help me.
The problem is simple: the file I specify to be 'written' to does not
get anything.  I tied the log.Info method to a button click, but when i
click, nothing happens.  
And I KNOW the button click is working.
Am I just leaving out somthing, or am I going about it all wrong?
My xml:
<?xml version="1.0" encoding="utf-8" ?> 


<appender name="fileAppender" type="log4net.Appender.FileAppender">

<param name="File" value="C:\logFile.txt"/>

<param name="AppendToFile" value="true"/>

<param name="ImmediateFlush" value="true" />

<layout type="log4net.Layout.PatternLayout">

<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />




<level value="INFO"/>

<appender-ref ref="fileAppender"/>




And my code contains the following:

static log4net.ILog log = log4net.LogManager.GetLogger("TestLog");




private void DoIt(object sender, EventArgs e)  // A button click calls
this method


log.Info("Do It was pushed");


private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e) // Closing the app calls this





View raw message