Thirupathi Thangavel Thirupathi Thangavel - 1 year ago 83
Linux Question

Setting permisison of log file in rsyslog configuration

There is an option in rsyslog configuration to set the permission & ownership of the log file created.

$fileOwner sv
if $programname contains 'my_process' then /var/log/my_process.log

If the log file (
) is not present, the file will be created with owner as "sv" user. Manual

But this will change the setting for all the forthcoming files as well.

Is there a way to the set the permission of only a particular log file?

Answer Source

I've found a way that works. After the configuration, reset the variable back to its default value.

$fileOwner sv
if $programname contains 'my_process' then /var/log/my_process.log
$fileOwner root
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download