I would like to use log4net on a windows service, the log4net
configuration that I have used is the same as I would use for a windows
or asp.net application, but the file does not seem to be getting
written out.
I know that I have the configuration file working ok, as I can access
other config values, but the log4net is not working.
Cheers David
<log4net>
<!-- Define some output appenders -->
<appender name="ConsoleAppender"
type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t]
%-5p %c [%x]
ID=%P{EventID} - %m%n" />
</layout>
</appender>
<appender name="LogFileAppender"
type="log4net.Appender.FileAppender">
<!--
<param name="File"
value="C:\_AppDev\Mt\MtWinService\bin\Debug\crazy-log.txt" />
-->
<param name="File" value="crazy-log.txt" />
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%5p
%c{1}:%L - %m%n" />
</layout>
<!-- Alternate layout using XML
<layout type="log4net.Layout.XMLLayout" /> -->
</appender>
<!-- Setup the root category, add the appenders and set the
default
level -->
<root>
<level value="ALL" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com