You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Owen Corpening <oc...@acornsys.com> on 2005/05/11 01:11:15 UTC

not getting a log file

This file /tmp/owen.config (I added everyone full-control to /tmp) is used:

<?xml version="1.0" encoding="utf-8" ?>
<log4net>
    <appender name="FileAppender" type="log4net.Appender.FileAppender">
        <file value="c:\\tmp\\log.txt" />
        <layout type="log4net.Layout.PatternLayout,log4net">
            <conversionPattern value="%5p %d (%c:%L) - %m%n" />
        </layout>
    </appender>
    <root>
        <level value="ALL" />
        <appender-ref ref="FileAppender" />
    </root>
</log4net>


using System.IO;
using System.Configuration;
using log4net;
using log4net.Config;
[assembly: log4net.Config.XmlConfigurator()]
namespace ManagedDLL
{
    // Interface declaration.
    public interface IConfigureActuateXml
     {
         int Edit(string filename);
     };
     // Interface implementation.
     public class ManagedClass:IConfigureActuateXml
    {
         private static readonly ILog log =
LogManager.GetLogger("ManagedClass");
         public int Edit(string filename)
        {
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new

System.IO.FileInfo(AppDomain.CurrentDomain.SetupInformation.ApplicationBase
+ "/tmp/owen.config"));
            log.Info("In Edit, filename = " + filename);
            return 1;
        }
    }
}