Answer the question
In order to leave comments, you need to log in
What is the best way to implement logging in C++?
I am writing a web server in C++ (only for linux) and I want to add an entry to the log file of requests from users. How to do it correctly in high load conditions?
Now I should have about 15 - 30 events per second that I want to put in the log, but the load will increase.
I plan to write to a file on disk, but I think there are already ready-made tools. And perhaps there are even better solutions than writing to the log file. In general, I would like to get acquainted with the best practices of this process.
Answer the question
In order to leave comments, you need to log in
https://github.com/gabime/spdlog Look at the benchmark results, maybe it's the best :)
The main logging tool in linux is syslog. There is nothing to fence the bike.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question