Comments (2)
If you create multiple file appenders targeting the same files, you are going to run into some issues. You have identified one, that is the flushing issue. In case of rolling appenders, there is also an issue with who does the rolling and how to synchronize it. In newer log4cplus, it is possible to specify UseLockFile
property and the appender will use file locking to synchronize appending to file and also rolling multiple files in rolling appenders. The flushing is silently enabled, if you use the UseLockFile
property. So, it is best to use single appender in a process per file.
The log level threshold filtering is done at two points,
- at the point of logging, logger is checked for threshold, if one is missing, the threshold is searched for by following path towards root logger
- in appender
Yes, the scenario that you are describing can happen. You are right that you have to be careful how you set up your logging properties / hierarchy. Log level threshold on the root logger serves as a threshold for all loggers without explicit log level threshold of their own. You are right that you have to add an appender filter on the root logger's appenders, if you want to avoid the scenario that you are describing. You could also turn off additivity for your one logger to avoid events to propagate towards root.
from log4cplus.
Ok, great - thanks a lot for your quick and comprehensive answer!
from log4cplus.
Related Issues (20)
- SysLogAppender: header elements should be limited in length
- [Question] Appender for AWS CloudWatch Logs HOT 2
- ./configure fails using c++2a HOT 3
- How to configure PatternLayout to use __FUNCTION__ HOT 7
- A link error occurred while compiling the my program. HOT 4
- Question: Effect of LOG4CPLUS_REQUIRE_EXPLICIT_INITIALIZATION on Windows? HOT 5
- Setting log level through env in log config file HOT 3
- Help needed: how to periodically flush logger with appender's immediateFlush set to false? HOT 2
- log file name not change after rollover TimeBasedRollingFileAppender HOT 3
- 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
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.