lwan
lwan copied to clipboard
Implement logging
- Write logs to shared memory
- Another process may save the logs or forward to another machine
- If logs are not saved, they're discarded
- Protected via seqlocks
What do you think about do it modular, we can have plugins to logging into a shm or to a pipe or wherever the user want, Is it a bad idea, the overhead will too much ?
The problem with pipes is that you need a syscall each time a request is logged -- whereas writing to a shared memory, you just write to the memory and the hardware takes care of controlling the access. I don't have numbers to prove it, but my intuition says that SHM will be a lot cheaper.
I tend to avoid having a modular design to avoid possible overhead.
In any case, having this feature is better than not having it, so if you're interested in implementing something, go for it!