Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >
article

KB-42660: How to change the path /var/log/message to a different path/folder in Rhel/Centos/Fedora

Auditing and Monitoring Service ,   Authentication Service ,   PC Auditing and Monitoring Service ,  

19 October,20 at 02:13 PM

Question: How do I redirect the system log file(s) stored in "/var/log/messages" to a different path/folder?

Answer:

1.    Create a directory where you would like the logs to be written to.

# mkdir /tmp/Centrifylog

User-added image


2.     In the rsyslog configuation file “/etc/rsyslog.conf”, replace the “/var/log/messages” with the new directory name. For example, replace the /var/log (path) below to the created folder/path called     
        /tmp/Centrifylog:

Before (example): 

*.info;mail.none;authpriv.none;cron.none                /var/log/messages

User-added image

After (example): 

*.info;mail.none;authpriv.none;cron.none                /tmp/Centrifylog/messages

User-added image

3.    Restart the rsyslog service.

# service rsyslog restart           ### CentOS/Fedora/RHEL 6

User-added image

# systemctl restart rsyslog       ### CentOS/Fedora/RHEL 7

User-added image

 

Still have questions? Click here to log a technical support case, or collaborate with your peers in Centrify's Online Community.