boost logging explicitly says it is not.

easylogging++ looks like it sets up extern'ed static state that might be trouble after a fork.

Requirements: log rolling after a certain size, support of logging levels, thread-safe.

I'd be happy with something that even needed to be reinitialized after forking.


I was successfully using spdlog in such scenario. Just initialize logger after calling fork.


  • 1
    Welcome aboard. this is a good answer (+1), but it is not very helpful. Normally, we ask you to explain why your recommendation meets the OP's needs. In this case, with the main emphasis being on Forking, I note that the page mentions benchmarking with a number of threads, so this should suit the OP's requirements. – Mawg says reinstate Monica Jan 8 '18 at 12:22
  • Actually spdlog is not fork-safe. The library employs localtime_r for formatting under the hood, which is not fork-safe. Even if you initialize a new logger in the child process, there is a global mutex in localtime_r implementation, which can be copied into child process in locked state (and from times to times it occurs). I'm currently using the library and trying to workaround the problem. – nicolai May 22 '20 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.