Change permissions for log_file

I enabled logging like this:

log_file = "/var/log/nomad.log"
log_rotate_duration = "24h"
log_rotate_max_files = 15

and the log_file permissions are 640, but for some internal processes to work properly, i would like to change that permissions to 644, but i dont see an configuration flag to use. can you help me? thanks!

if I read this correctly, 640 is hardcoded at file creation, so i guess there’s no way to pass a different mode

maybe you can consider this as a feature request?

Hi @sandrotosi,

As you have discovered there is no configuration parameters to alter the permissions used to create the default log file. It is currently expected that any changes are handled outside of Nomad via something like this Ansible task. Feel free to open a feature request, if you would like this option added to Nomad.

jrasell and the Nomad team

This will not persist once the log file is rotated, correct? Maybe a system cron (via crontab) could be a better hack than an Ansible?

Hi there,

To change the permissions of your log file, you can use the chmod command in your terminal. Simply run chmod 644 /var/log/nomad.log to set the Lotus365 permissions to 644. Hope this helps.

it doesnt help. the moment the log file rotates, the permissions are reset to 640