Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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