You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Dominik Psenner (JIRA)" <ji...@apache.org> on 2017/09/30 16:18:01 UTC

[jira] [Closed] (LOG4NET-577) Log4net gives error on UpdateLogFilePath when logfilepath changes dynamically for an appender.

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

Dominik Psenner closed LOG4NET-577.
-----------------------------------
    Resolution: Information Provided

I believe that it would be wise to refactor your codebase such that the logging framework is instantiated and configured at startup. Typically I recommend to have one ILog instance for every class by adding a static field or property. Note also that while reconfiguring the framework at runtime is supported, there are edge cases that need to be taken care of.

Please reopen the issue in case you have further questions.

> Log4net gives error on UpdateLogFilePath when logfilepath changes dynamically for an appender.
> ----------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-577
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-577
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.11
>         Environment: Windows 
>            Reporter: Nilesh R Deo
>            Assignee: Dominik Psenner
>
> We get the following errors randomly in our Windows service. And the service hangs sometimes. Can you please suggest a resolution. The logfilepath is set dynamically from database table for the appender. 
> Error validating Tagged message. StackTrace:   at log4net.Appender.FileAppender.ActivateOptions()
>    at log4net.Appender.RollingFileAppender.ActivateOptions()
>    at TtsEmea.ImagingWorkflow.Log4NetWrapper.Log4NetLogger.UpdateLogFilePath(String appender, String logFilePath)
>    at TtsEmea.ImagingWorkflow.Common.LogWrapper.LogFactory.GetLoggerBasedOnType(LoggerType type, String appender, String logFilePath)
>    at TtsEmea.ImagingWorkflow.Common.LogWrapper.LogManager.GetLoggerFactory(String configurationFilePath, String appender, String logFilePath)
>    at IntellectFlow.Classes.cMessageLog.WriteInfoMessage(String strMessage)
>    at IntellectFlow.Classes.cFileRecordSet.GetIndexValueForTagged()
>    at IntellectFlow.Classes.cFileRecordSet.ValidateTagged()
> Error creating TIF file.   at log4net.Appender.FileAppender.ActivateOptions()
>    at log4net.Appender.RollingFileAppender.ActivateOptions()
>    at TtsEmea.ImagingWorkflow.Log4NetWrapper.Log4NetLogger.UpdateLogFilePath(String appender, String logFilePath)
>    at TtsEmea.ImagingWorkflow.Common.LogWrapper.LogFactory.GetLoggerBasedOnType(LoggerType type, String appender, String logFilePath)
>    at TtsEmea.ImagingWorkflow.Common.LogWrapper.LogManager.GetLoggerFactory(String configurationFilePath, String appender, String logFilePath)
>    at IntellectFlow.Classes.cMessageLog.WriteInfoMessage(String strMessage)
>    at IntellectFlow.Classes.cFileRecordSet.WriteTextToTIFF(String sContent, String sFile) 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)