RollingFileAppender with varying dynamic filenames not working
--------------------------------------------------------------

                 Key: LOG4NET-219
                 URL: https://issues.apache.org/jira/browse/LOG4NET-219
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10
         Environment: OS: Windows Server 2003, Sharepoint 2007
            Reporter: Amar G


The Log4Net configuration file is as below:
<log4net>
                <appender name="RollingFile" 
type="log4net.Appender.RollingFileAppender">
                        <file type="log4net.Util.PatternString" 
value="C:\ErrorLog\%property{LogPath}"></file>
                        <appendToFile value="true"></appendToFile>
                        <maximumFileSize value="1024KB"></maximumFileSize>
                        <maxSizeRollBackups value="2"></maxSizeRollBackups>
                        <layout type="log4net.Layout.PatternLayout">
                                <conversionpattern value="%newline%date - 
%message%newline"></conversionpattern>
                        </layout>
                </appender>
                             <logger name="File">
                        <level value="All" />
                        <appender-ref ref="RollingFile" />
                </logger>
        </log4net>

In my application the debug method for logging the information will be called 
many times. Some messages should get stored in a file with name say xy.log and 
some messages should get stored in a file with name say ab.log.

In Global.asax i have written the following code:

log4net.Config.XmlConfigurator.ConfigureAndWatch(new 
System.IO.FileInfo(Server.MapPath("/Log4Net.config")));
The above LOC is written in the Application_Start event

Actual call to the debug method:

 log4net.GlobalContext.Properties["LogPath"] = 
String.Concat(FilePrefix,"_Debug.log");
            log4net.ILog filelogger = log4net.LogManager.GetLogger("File");
            filelogger.Debug(info);

Issue: Although the property named LogPath is getting set properly, i dont see 
any file with the name specified through the code getting created in the path 
specified.

Can you please look into this and let me know whether i am missing something or 
whether it is not supported?

Thanks in advance.....

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to