lraulea commented on issue #234:
URL: 
https://github.com/apache/logging-log4net/issues/234#issuecomment-2771803819

   @FreeAndNil unfortunately not much better
   
   I've noticed that these 191 bytes are actually empty files.
   
   Quite many empty files are created, sometimes I get the impression that the 
empty files are re-created because the creation data changes.
   
   ```
   4/2/2025 10:11:03 AM, ProcessFileBeforeOpen > (baseFileName = LM-Starter, 
append = True)
   4/2/2025 10:11:03 AM, ProcessFileBeforeOpen < ()
   4/2/2025 10:11:03 AM, ProcessFileBeforeOpen > (baseFileName = LM-Starter, 
append = True)
   4/2/2025 10:11:03 AM, ProcessFileBeforeOpen | logFile LM--202504021011.log.0 
(Moved to .tip succeeded, file size 191)
   4/2/2025 10:11:03 AM, ProcessFileBeforeOpen < ()
   ...
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen > (baseFileName = LM-Starter, 
append = True)
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen | logFile 
LM-Starter-202504021011.log.0 (Move to .tip failed: Cannot create a file when 
that file already exists, file size 191)
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen | logFile 
LM-Starter-202504021011.log.0.tip (Nothing to be done to .tip file)
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen < ()
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen > (baseFileName = LM-Starter, 
append = True)
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen | logFile 
LM-Starter-202504021011.log.0 (Move to .tip failed: Cannot create a file when 
that file already exists, file size 191)
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen | logFile 
LM-Starter-202504021011.log.0.tip (Nothing to be done to .tip file)
   4/2/2025 10:11:07 AM, ProcessFileBeforeOpen < ()
   ...
   4/2/2025 10:12:00 AM, ProcessFileBeforeOpen > (baseFileName = PF-System, 
append = False)
   4/2/2025 10:12:00 AM, ProcessFileBeforeOpen | logFile 
PF-System-202504021011.log.0 (Move to .tip failed: The process cannot access 
the file because it is being used by another process, file size 192)
   4/2/2025 10:12:00 AM, ProcessFileBeforeOpen | logFile 
PF-System-202504021011.log.0.tip (Nothing to be done to .tip file)
   4/2/2025 10:12:00 AM, ProcessFileBeforeOpen < ()
   4/2/2025 10:12:41 AM, ProcessFileBeforeOpen > (baseFileName = EM-Starter, 
append = False)
   4/2/2025 10:12:41 AM, ProcessFileBeforeOpen | logFile 
EM-Starter-202504021011.log.0 (Move to .tip failed: The process cannot access 
the file because it is being used by another process, file size 191)
   4/2/2025 10:12:41 AM, ProcessFileBeforeOpen < ()
   ...
   ```
   
   Let's get a step back and see what the use case was:
   
   > a log file has been created, the app has been closed, after the rollover 
date moment the app is restarted. The AdjustFileBeforeAppend() has currentFile 
equal to File (!). Consequence of this is that the file created in previous 
instance, is left unzipped.
   
   @FreeAndNil could this new zip-old-rolled-file feature be cleanly built 
inside log4net? Hooking into log4net with overrides seems too complex.
   
   


-- 
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

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

Reply via email to