[Log4cplus-devel] [log4cplus:bugs] #332 AsyncAppender/RollingFileAppender combination error.
Logging Framework for C++
Brought to you by:
wilx
From: Václav H. <wi...@us...> - 2017-02-01 09:55:13
|
- **status**: open --> closed --- ** [bugs:#332] AsyncAppender/RollingFileAppender combination error.** **Status:** closed **Group:** v1.2.0 **Created:** Mon Jun 13, 2016 12:57 PM UTC by Jakob Krogh Bodilsen **Last Updated:** Wed Feb 01, 2017 09:25 AM UTC **Owner:** Václav Haisman We are using AsyncAppender combined with RollingFileAppender in the following manner: ~~~ log4cplus.appender.logfile=log4cplus::AsyncAppender log4cplus.appender.logfile.QueueLimit=10000 log4cplus.appender.logfile.Appender =log4cplus::RollingFileAppender log4cplus.appender.logfile.Appender.layout=log4cplus::PatternLayout log4cplus.appender.logfile.Appender.BufferSize=10000 log4cplus.appender.logfile.Appender.ImmediateFlush=true log4cplus.appender.logfile.Appender.File=d:/wpslog/hppp/Core.log.txt log4cplus.appender.logfile.Appender.DatePattern='.'yyyy-MM-dd log4cplus.appender.logfile.Appender.MaxFileSize=250KB log4cplus.appender.logfile.Appender.MaxBackupIndex=10 log4cplus.appender.logfile.Appender.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q} [%t] %-5p %c - %m%n ~~~ The same process logs to several appenders. Several threads in this process logs to the appender above, but only this one process uses the appender. After processstart the rollingfile logic works as expected. After having modified the log properties file (and empty line is enough), the txt log file is never renamed to txt.1, however the file is still cleared when reaching filesize limit and logging continues from scratch. Furthermore the renaming/deletion of any remaining txt.\* files are still done, so that at some point only the .txt file remains. Some debug log from log4cplus immedately after saving the log.properties file: ``` log4cplus: Queue thread started. log4cplus: Just opened file: d:/wpslog/hppp/Core.log.txt log4cplus: Queue thread started. log4cplus: Just opened file: d:/wpslog/hppp/timeStatisticLogFile.log.txt log4cplus: Queue thread started. log4cplus: Entering ConsoleAppender::close().. log4cplus: Destroying appender named [stdout]. log4cplus: Destroying appender named [nteventlog]. log4cplus: Renamed file d:/wpslog/hppp/Core.log.txt.2 to d:/wpslog/hppp/Core.log.txt.3 log4cplus: Renamed file d:/wpslog/hppp/Core.log.txt.1 to d:/wpslog/hppp/Core.log.txt.2 log4cplus: Renaming file d:/wpslog/hppp/Core.log.txt to d:/wpslog/hppp/Core.log.txt.1 log4cplus:ERROR Failed to rename file from d:/wpslog/hppp/Core.log.txt to d:/wps log/hppp/Core.log.txt.1; error 13 log4cplus: Just opened file: d:/wpslog/hppp/Core.log.txt ``` The behaviour is consistent. If changing the appender to be RollingFileAppender only (without AsyncAppender) the issue dissappears. Any help is appreciated. --- Sent from sourceforge.net because log...@li... is subscribed to https://sourceforge.net/p/log4cplus/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/log4cplus/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |