I use a symlink. The logger sees the link as a file, and the file system is responsible for writing the data to the linked location instead. The link is not a copy of the log, but just a pointer to another path on the file system.
Go to your logging folder:
cd /var/log/asterisk/
Make a link to a new file in /var/log/asterisk-remote (adjust the target path to your needs).
sudo ln -s /var/log/asterisk-remote/other-log /var/log/asterisk/link-log
View the link:
ls -ll
lrwxrwxrwx 1 root root 34 Oct 2 16:12 link-log -> /var/log/asterisk-remote/other-log
Then in /etc/asterisk/logger.conf
just add the link's name (with whatever types of log messages you want it to receive):
[logfiles]
messages => notice,warning,error
link-log => notice,warning,error
Be sure to reload your config to apply the changes (this is done in the Asterisk CLI, which you can access via asterisk -r
in the shell):
core reload