logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d_k <mail...@gmail.com>
Subject Re: How to specify a log output folder in RollingFileAppender
Date Sat, 02 Aug 2014 19:28:11 GMT
In order to write to the C: drive your application should run as an
administrator. Run it as an Administrator and see if it helps.

You can also configure log4net internal logging to see why it fails or
download the source and attach it.

To enable the internal logging add the following to your app.config:

  <appSettings>
    <add key="log4net.Internal.Debug" value="true"/>
  </appSettings>
  <system.diagnostics>
    <trace autoflush="true">
      <listeners>
        <add
        name="textWriterTraceListener"
        type="System.Diagnostics.TextWriterTraceListener"
        initializeData="log4net-debug.txt" />
      </listeners>
    </trace>
  </system.diagnostics>


On Sat, Aug 2, 2014 at 8:09 PM, Shing Hing Man <matmsh@yahoo.com> wrote:

> Hi,
>   I am trying to set up llog4net  to use RollingFileAppender in  F# in VS
> 2013.
>
>  <appender name="Roll" type="log4net.Appender.RollingFileAppender">
>       <file      value="log_"/>
>       <appendToFile value="true"/>
>       <rollingStyle value="Date"/>
>       <staticLogFileName value="false" />
>       <datePattern value="yyyy_MM_dd.'txt'"/>
>       <layout type="log4net.Layout.PatternLayout">
>         <conversionPattern value="%date [%thread] %-5level %logger - %m%n"
> />
>       </layout>
>     </appender>
>
> The above works. The log file log_2014_08_02.txt ends up  in
> {project}/bin/Debug directory.
>
> However, I would like the log file to be in c:\ ,say.
> I have tried
>     <file      value="c:\log_"/>
> and
>   <file      value="${HOMEDRIVE}\log_"/>
> but none of the above works.
>
> How to set up <file> so that the output directory is in c:\  ?
> Thanks in advance for your assistance!
>
> Shing
>
>
>
>
>
>
>
>

Mime
View raw message