Torsten
Torsten

Reputation: 24176

Best way for implement multiprocess logging (C++)

I search of mechanism for implement multiprocess logging (cross-platform solution, windows and linux). Currently, i see only one way - use log file with locking. Lock - write, unlock.

But may be somebody know something better?

Upvotes: 3

Views: 1229

Answers (2)

log0
log0

Reputation: 10917

The good partner is Producer/Consumer.

Each thread enqueues in a list. And one thread consume this list and write in a file.

Upvotes: 2

kol
kol

Reputation: 28698

Create a logger application and send log entries to it over TCP sockets.

Upvotes: 2

Related Questions