logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Quest <christopher.qu...@herbertgroup.com>
Subject Class Library Logging
Date Mon, 03 Apr 2006 15:43:12 GMT
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().Declari
ngType);

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