Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-521

AdjustFileBeforeAppend() NullReferenceException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.15
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows et. al.

      Description

      When the log file is open and the service attempts to roll the log file the service will terminate with an unhandled NullReferenceException:

      Exception StackTrace
      Application: Synovia.Service.exe
      Framework Version: v4.0.30319
      Description: The process was terminated due to an unhandled exception.
      Exception Info: System.NullReferenceException
         at log4net.Appender.RollingFileAppender.AdjustFileBeforeAppend()
         at log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent)
         at Synovia.Service.Common.Common.Logging.AsyncFileAppender.LogMessages()
         at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
         at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
         at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
         at System.Threading.ThreadHelper.ThreadStart()
      
      <log4net>
          <root>
            <level value="ALL" />
            <appender-ref ref="asyncForwarder" />
          </root>
      
      
      	<appender name="asyncForwarder" type="Log4Net.Async.ParallelForwardingAppender,Log4Net.Async">
            <appender-ref ref="LossyAppender" />
            <appender-ref ref="LogFileAppender" />
      	  <bufferSize value="2147483644" />
          </appender>
      	
          <appender name="LossyAppender" type="log4net.Appender.BufferingForwardingAppender">
            <bufferSize value="200" />
            <lossy value="true"/>
            <evaluator type="log4net.Core.LevelEvaluator">
              <threshold value="WARN"/>
            </evaluator>
            <appender-ref ref="LogglyAppender" />
      	</appender>
      	 <appender name="LogglyAppender" type="log4net.loggly.LogglyAppender, log4net-loggly">
            <rootUrl value="https://logs-01.loggly.com/" />
            <inputKey value="?????" />
            <tag value="GOLD_M1_S1" />
      	  <filter type="log4net.Filter.LevelRangeFilter">
              <levelMin value="WARN" />
              <levelMax value="FATAL" />
            </filter>
          </appender>
      	
          <appender name="LogFileAppender" type="Synovia.Service.Common.Common.Logging.AsyncFileAppender">
            <lockingModel type="log4net.Appender.FileAppender+ExclusiveLock" />
            <file value="logs\" />
            <datePattern value="dd.MM.yyyy'.log'" />
            <appendToFile value="true" />
            <rollingStyle value="Composite" />
            <maxSizeRollBackups value="20" />
            <maximumFileSize value="200MB" />
            <staticLogFileName value="false" />
            <layout type="log4net.Layout.PatternLayout">
              <conversionPattern value="%date{MM/dd/yyyy HH:mm:ss.fffffff}|%logger|%thread|%-5level|%message|%newline" />
            </layout>
          </appender>
      
        </log4net> 
      
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              william.j.davis5@gmail.com WILLIAM J DAVIS
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: