I am finding a way to implement a log mechanism that several processes write their behaviors (mainly for error and execution sequence of processes) to it by C with Linux?
Just open a file that shared for multi-processes and let processes fprintf() to it? Any smart way to implement an option/mechanism that controls the level of log such as error/detail/high or something like it?
It would be better if you could refer me to a light opensource for this?
Thanks.
Use
syslog, it’s the standard (POSIX) logging solution.