Comments (3)
I think this works as intended. The filename
is constant, e.g., app.log
. When schedule period ends, the filename
, gets renamed to scheduledFilename
and the new current period uses the filename
for logging again.
from log4cplus.
I get it. If the initial filename is not empty, then this logic is correct.
My issue might be that the initial filename was not provided in the configuration file, which caused the problem.
Is it more reasonable to prohibit running when the filename is empty rather than continuing to run, which may potentially cause errors?
from log4cplus.
encountered another problem
If RollOnClose
is on, subsequent logs for the day will overwrite the previous one.
If RollOnClose
is off, and the app was closed normally the day before yesterday and reopened the next day, rollover
will never be triggered, and all logs will be in the same file specified by filename
.
The following is my configuration file, I do not know what is wrong.
log4cplus.rootLogger=INFO, COMMON
log4cplus.logger.Hope=ALL
log4cplus.appender.COMMON=log4cplus::TimeBasedRollingFileAppender
log4cplus.appender.COMMON.File=${AppData}\Log\gw.log
log4cplus.appender.COMMON.FilenamePattern=${AppData}\Log\gw_%d{yyyy_MM_dd}.log
log4cplus.appender.COMMON.AsyncAppend=true
log4cplus.appender.COMMON.CreateDirs=true
log4cplus.appender.COMMON.MaxHistory=30
log4cplus.appender.COMMON.CleanHistoryOnStart=false
log4cplus.appender.COMMON.RollOnClose=true
log4cplus.appender.COMMON.layout=log4cplus::PatternLayout
log4cplus.appender.COMMON.layout.ConversionPattern=%D{%Y/%m/%d %H:%M:%S} [%-5t] %-5p: %m [%M in %l]%n
log4cplus.appender.CONSOLE.filters.1=log4cplus::spi::LogLevelRangeFilter
log4cplus.appender.CONSOLE.filters.1.LogLevelMin=DEBUG
log4cplus.appender.CONSOLE.filters.1.LogLevelMax=FATAL
log4cplus.appender.CONSOLE.filters.1.AcceptOnMatch=true
from log4cplus.
Related Issues (20)
- log's maxsize>200kb,but it dosen't work HOT 2
- Opentelemetry integration HOT 1
- What kind of compilation options can correctly generate a multi-threaded logging library HOT 5
- Win64 application crash on exit HOT 1
- Why mingw can't complie log4cplus-2.1.1? HOT 1
- Sending logs from log4cplus to log4j via TCP HOT 1
- Is it possible to build log4cplus for QNX aarch64le? HOT 3
- Save all configuration in a file HOT 2
- Question: Which latest version of Log4cplus I should use on RedHat 7.9 with DevToolset11-toolchain ( GCC 11.2 ) compiler HOT 7
- Does not work when maxBackupIndex is set to 0 HOT 1
- Include Headers Possibly Causing Build Error HOT 5
- how to set FD_CLOEXEC for log4cplus HOT 1
- Inconsistent Log File Permissions HOT 2
- Question: Which latest and stablest version of Log4cplus I should use on CentOS Linux 7 with GCC version 4.8.5 compiler HOT 1
- 'LOG4CXX_ASSERT' equivalent HOT 2
- Feature request: non-blocking logging with SyslogAppender HOT 6
- log4cplus doesn't compile with --enable-thread-pool=no and --enable-threads=no
- Crash when using log4plus::RollingFileAppender HOT 2
- Update Visual Studio projects with newly added files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log4cplus.