You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2020/04/04 22:30:05 UTC

[jira] [Updated] (LOG4NET-219) RollingFileAppender with varying dynamic filenames not working

     [ https://issues.apache.org/jira/browse/LOG4NET-219?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers updated LOG4NET-219:
--------------------------------

LOG4NET is now dormant.  

> 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
>            Priority: Major
>             Fix For: 1.2/2.0 Maintenance Release
>
>         Attachments: log4netinternaldebug.txt
>
>
> 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 was sent by Atlassian Jira
(v8.3.4#803005)