Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2.10
-
None
-
OS: Windows Server 2003, Sharepoint 2007
Description
The Log4Net configuration file is as below:
<log4net>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="C:\ErrorLog%property
"></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.....
Attachments
Attachments
Issue Links
- is superceded by
-
LOG4NET-367 RollingFileAppender-NG: rewrite the RollingFileAppender
- Open