Running centos 7, my rsyslog.conf looks like this:

 59 # Log all the mail messages in one place.
 60 mail.* /var/log/maillog
 61 mail.* /var/log/logtest1
 62 mail.* /root/logtest

Then I use the logger command like so:

logger -p mail.err "this is one logsdsdfgsdfgdfsg"

Now this is written in the /var/log/maillog and /var/log/logtest1, but it's not written in /root/logtest.

I also ran systemctl restart rsyslog and also rebooted my system several times.

Is this intentional, or is it a bug? Either way, how would I force it to write my logs wherever I want?

1 Answer 1


Do you have SELinux enabled ? if yes, then writing it into /root is bad idea. You need to label your /root/logtest directory as chcon -t var_log_t /root/logtest and probably chcon -t var_t /root

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.