logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Brown" <octav...@gmail.com>
Subject Re: Class Library Logging
Date Mon, 03 Apr 2006 20:31:46 GMT
Is there a reason why there are no appender-ref's in the root element? I
would start there...

I think the next step someone would ask is if you see anything using the
internal log4net logging.

On 4/3/06, Christopher Quest <christopher.quest@herbertgroup.com> wrote:
>
> Hi,
>
> I am using V1.2.0-beta8, on a test .DLL written in C# against .NET1.1 with
> the DLL being called from a C# windows application.
>
> I have this attribute in the the Assemblyinfo.cs file:
>
> [assembly: DOMConfiguratorAttribute(ConfigFile="UIFeasibility.log.config
> ",Watch=true)]
>
> I am setting up the logger as follows:
>
> private static readonly ILog log = LogManager.GetLogger(
> System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
>
> Then using the logger as normal:
>
> if (log.IsDebugEnabled) log.Debug("Constructor called");
>
> This is my configuration file:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <log4net>
>         <logger name="UIFeasibility" additivity="false">
>                 <level value="DEBUG"/>
>                 <appender-ref ref="FileAppender" />
>         </logger>
>
>         <root>
>                 <level value="DEBUG" />
>         </root>
>
>         <appender name="FileAppender" type="log4net.Appender.FileAppender
> ">
>                 <file value="Log-file.txt"/>
>                 <appendToFile value="true"/>
>                 <filter type="log4net.Filter.LevelRangeFilter">
>                         <levelMin value="INFO"/>
>                         <levelMax value="FATAL"/>
>                 </filter>
>                 <layout type="log4net.Layout.PatternLayout">
>                         <conversionPattern value="%date  %-5level %logger
> - %message%newline" />
>                 </layout>
>         </appender>
>
> </log4net>
>
> When the class library is accessed all of the log statments are executed
> but after the windows application is closed down there is not text in the
> log file even though it is created if it doesn't exists. This mechanism has
> perviously worked on a windows service.
>

Mime
View raw message