Git Product home page Git Product logo

Comments (2)

wilx avatar wilx commented on May 24, 2024

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,

  1. 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
  2. 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.

kaufManu avatar kaufManu commented on May 24, 2024

Ok, great - thanks a lot for your quick and comprehensive answer!

from log4cplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.