tmct opened a new issue, #223:
URL: https://github.com/apache/logging-log4net/issues/223

   Hi,
   
   A more serious problem than the one I reported yesterday: we cannot upgrade 
from 2.0.15 to 2.0.17 because our key FileAppender is completely failing to 
write anything to the main log file.
   
   ```
   log4net: Opening file for writing 
[/my/code/is/here/bin/Debug/net8.0/log_20250130-185019-0634.txt] append [False]
   log4net:ERROR [FileAppender] ErrorCode: FileOpenFailure. 
OpenFile(/my/code/is/here/bin/Debug/net8.0/log_20250130-185019-0634.txt,False) 
call failed.
   System.NullReferenceException: Object reference not set to an instance of an 
object.
      at log4net.Appender.FileAppender.OpenFile(String fileName, Boolean append)
      at log4net.Appender.FileAppender.SafeOpenFile(String fileName, Boolean 
append)
   log4net: Opening file for writing 
[/my/code/is/here/bin/Debug/net8.0/log_20250130-185019-0634.txt] append [False]
   ```
   
   This appears to be another case of the problem witnessed in #118 that 
precipitated the release of 2.0.17 - m_lockingModel is now set lazily, and may 
be null when accessed. ActivateOptions is immune to this: it creates the 
locking model if it does not exist, so I was wondering if FileAppender.OpenFile 
should copy that behaviour - or possible we could encapsulate the lazy setting 
into the LockingModel property? I'm not sure why ActivateOptions seemingly 
hasn't been called before this - is that indicative of a bug or race condition 
elsewhere?
   
   Would you mind if we fixed 2.x please?
   
   Thanks,
   Tom 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to