It depends on the version of Linux that you are using, but based on your member information, I will assume you are referring to CentOS 6.4.
In this case, you will edit the /etc/rsyslog.conf file. Change the destination in the RULES section to the desired locations.
Example:
Change:
Code:
#### RULES ####
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
to:
Code:
#### RULES ####
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /path/to/new/location
You will need to restart the service after the changes are saved.
Code:
service rsyslog restart
These changes will need to be made on each line of the type of log file that you want to be written in the new location.