V
V
Viktor2015-08-16 04:06:02
linux
Viktor, 2015-08-16 04:06:02

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

2 answer(s)
S
Stanislav, 2015-08-16
@Levhav

https://github.com/gabime/spdlog Look at the benchmark results, maybe it's the best :)

A
Armenian Radio, 2015-08-16
@gbg

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 question

Ask a Question

731 491 924 answers to any question