logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Schall" <mike.sch...@gmail.com>
Subject Re: no log file is created
Date Thu, 21 Jun 2007 16:03:26 GMT
The user the application is running as has to have rights to write to /
create files in the folder where you are logging.  Keep in mind that if you
are debugging, that might be a different relative path than if you are
running the program directly.  I use an absolute path for my rolling file
appenders and they work great.

Mike

On 6/21/07, Samuel Rochas <samuel.rochas@iesedu.com> wrote:
>
> Dear all,
>
> I use to work with Log4j but I am new to Log4net. I try to setup a small
> example but no file is created while logging, though the line with the
> log instruction is executed. This is my setup, any hint? Thank you in
> advance.
>
> *** web.config ***
> <configuration>
>   <!-- Register a section handler for the log4net section -->
>   <configSections>
>     <section name="log4net"
> type="System.Configuration.IgnoreSectionHandler" />
>   </configSections>
>   <appSettings>
>     <!-- To enable internal log4net logging specify the following
> appSettings key -->
>     <!-- <add key="log4net.Internal.Debug" value="true"/> -->
>   </appSettings>
>   <!-- This section contains the log4net configuration settings -->
>   <log4net>
>     <!-- Define some output appenders -->
>     <appender name="A1" type="log4net.Appender.RollingFileAppender">
>       <file value="log.txt" />
>       <appendToFile value="true" />
>       <maxSizeRollBackups value="10" />
>       <maximumFileSize value="1024KB" />
>       <rollingStyle value="Size" />
>       <staticLogFileName value="true" />
>       <layout type="log4net.Layout.PatternLayout">
>         <!--
>         <header value="[Header]&#13;&#10;" />
>         <footer value="[Footer]&#13;&#10;" />-->
>         <conversionPattern value="%date [%thread] %-5level %logger
> [%ndc] - %message%newline" />
>       </layout>
>     </appender>
>     <root>
>       <level value="DEBUG" />
>       <appender-ref ref="A1" />
>     </root>
>     <logger name ="L1">
>       <level value="DEBUG" />
>       <appender-ref ref="A1" />
>     </logger>
>   </log4net>
> *********************
>
> *** My code ***
>     public static class Query
>     {
>         // Logger instance
>         private static readonly ILog log =
> LogManager.GetLogger(typeof(Query));
>
>         public static ArrayList myMethod(string id_p, string course_p)
>         {
>              log.Debug("Entering application.");
>
>
> *****************
>
>

Mime
View raw message