Git Product home page Git Product logo

Comments (5)

wilx avatar wilx commented on July 24, 2024 1

If anyone sets the AsyncAppend=true option and the thread pool has been disabled at compile time, the code will silently use the synchronous logging instead: https://github.com/log4cplus/log4cplus/blob/2.1.x/src/appender.cxx#L296-L320

from log4cplus.

wilx avatar wilx commented on July 24, 2024

See global-init.cxx for the gory details of initialisation and deinitialisation. The LOG4CPLUS_REQUIRE_EXPLICIT_INITIALIZATION does something for initialisation only. It does not do anything for deinitialisation. The deinitialisation is necessary mainly for the thread pool to be shut down. If you are not going to use the asynchronous logging feature, you can set LOG4CPLUS_ENABLE_THREAD_POOL=OFF at compile time and the thread pool will not be created. I have not tested this but I think you should not get stuck threads when you exit main() even without the Initializer

from log4cplus.

kritzel avatar kritzel commented on July 24, 2024

Thanks a log @wilx for your swift response. It makes the matter totally clear to me.
We are using the configuration file to configure the framework, so I cannot rule out that someone would use the AsyncAppender. Hence, I cannot disable the thread pool (correct me if I am wrong).

I just wanted to make sure not to miss any built-in option to solve the issue. I will now implement a viable workaround in my shared library.

Shall I close this issue now?

from log4cplus.

kritzel avatar kritzel commented on July 24, 2024

This is incredible @wilx ! I am really baffled by your support! Thank you so much. I'll try this ASAP and give you feedback here. But I have no doubt that your patch is going to work.

Thanks again, this project is amazing.

from log4cplus.

kritzel avatar kritzel commented on July 24, 2024

@wilx The feedback as promised: The patch works nicely on windows (and is not needed on Linux). To me this issue has now been entirely solved within a single day :-D

Thanks a lot for your great support. I'll close the issue now.

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.