David,

This sort of issue is usually related to permissions. Ensure that the
account that the service is running under has read/write/create permission
on the directory that the log file is to be written into.

You can also enable internal log4net debugging which should display any
errors the appender is encountering.
http://logging.apache.org/log4net/release/manual/faq.html#internalDebug

Cheers,
Nicko

> -----Original Message-----
> From: David Cruwys [mailto:[EMAIL PROTECTED] 
> Sent: 12 May 2004 09:11
> To: [email protected]
> Subject: LogFileAppender and Windows Service
> 
> 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
> 

Reply via email to