Running a wire?
First set of questions:
- Do you need all these log files?
- All time?
- Can you control how many entries are happening?
- Why not?
Second set of questions:
- Why are your journal entries slower?
- Are you using inappropriate operations (like O_SYNC or related parameters in POSIX)?
- How many disk drives do you have?
- Can you get different log files on different drives (or at least have log files on a different drive where other files are stored)?
As @igalse reports, there are log libraries available. For C ++, you should look at what's available in Boost , but there are undoubtedly other sources as well.
source to share
For C ++, Boost does not contain a logging library. But you can use the most advanced candidate written by John Toho here .
It allows you to filter out some of your logging (you'll probably need it if logging is so important that it becomes a performance issue) and configuring different assignments like stream.
source to share
If the I / O input on the host is unduly affected, then in my opinion you either:
- Doing FAR Too Much Logging - Logging is enough to get close to IO write speed on a consistent basis, probably too much, as even the most modest hardware can comfortably run a few megabytes per second without issue.
- Doing too many flushes of your logs is more likely. Syslogd dumps the log quite heavily by default (too much for log-intensive applications) - this is so the log files are durable in case of failure but generate a lot of IO. Syslogd can be reconfigured for each file (see its man page) to not dump files as often.
Registering with a network server will not solve these problems if it has the same problem - in fact it will make them worse if multiple hosts register on the same server.
source to share