Artificial intelligent assistant

how to use syslog to avoid log file being garbled when multiple proceses are trying to write to the same log fille? I wanted to know usage of syslog when multple processes are trying to write to the same log file like for i in $var do some process >> logfile & done wait

You can do


some process | logger &


to spawn processes and have their output directed to syslog. Notice that the default facility will be “user” and the default level “notice”. You can change them using the `-p` option.

The reason why this works without probelm is that the processes don't directly write to the destination file. They send their messages to the syslog daemon, which manages writing to the appropriate file(s). As far as I understand things, the atomicity would be line-based, i.e. every line of output from a process would go to syslog without interference, but multi-line messages might get lines from other processes mixed in.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 4bdcc473d2f4ac3abcb7629a009c2900