I want to use syslog to do some bash script logging.

I see /etc/rsyslog.d/50-default.conf, but I'm new to syslog. I want to configure local0 for logging for my scripts.

Should I be editing this configuration file? It has a bizarre name that throws me off. Or should I be creating some new file for my configuration that gets read somehow?

I just want to follow established standards here.


You could use the utility logger, as in the following example:

logger -p local0.notice -t MYTAG "my message"

In the default rsyslog configuration, it will appear on /var/log/syslog as

Jul 11 12:16:23 enzotib-laptop MYTAG: my message

If you want to log to some other file, you should modify /etc/rsyslog.d/50-default.conf, or better add another files under the same directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.