Skip to content

Multiple loggers from different instances of the same application writing to the same file #3178

Answered by tt4g
varkey98 asked this question in Q&A
Discussion options

You must be logged in to vote
[*** LOG ERROR #0103 ***] [2024-09-11 15:12:15] [random] async log: thread pool doesn't exist anymore

This error message reports that the thread pool used by the async logger has been deleted.
Please redesign your application so that the thread pool is not deleted.

// send the log message to the thread pool
SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg){
SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){
pool_ptr->post_log(shared_from_this(), msg, overflow_policy_);
}
else {
throw_spdlog_ex("async log: thread pool doesn't exist anymore");
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@varkey98
Comment options

Answer selected by varkey98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants