Nomad logging confusion

Hi folks :wave:

I stumbled across something which may be a bug or it may just be something I have misunderstood.

Essentially I am trying to pipe the various nomad logs into certain files but somehow nomad always generates the files as nomad-{timestamp}.log ? :thinking:

Nomad version is v1.1.2+ent.

Configuration of the ordinary agent logs in nomad.hcl :point_down:

# log settings
...
log_file  = "/var/log/nomad.log"
...

Configuration of the Enterprise audit logs in nomad.hcl :point_down:

sink "audit" {
    ...
    path   = "/var/log/nomad_audit.log"
    ...
}

The result of this config …

root@xxx:/var/log# ls -alh /var/log/nomad*
-rw-r----- 1 root root 8.3K Aug 18 11:22 /var/log/nomad-1629283904922740456.log
-rw-r----- 1 root root 7.7K Aug 18 11:22 /var/log/nomad-1629285757963036138.log
-rw------- 1 root root 2.1M Aug 18 11:22 /var/log/nomad_audit-1629283907665719584.log
-rw------- 1 root root 1.1M Aug 18 11:42 /var/log/nomad_audit-1629285759194447584.log

This seems … weird?

Hmm, it looks like this is not intended. The docs say:

log_file (string: "") - Specifies the path for logging. If the path does not includes (sic!) a filename, the filename defaults to “nomad-{timestamp}.log”.

Hi @fhemberger,

Indeed - I’ll file an issue against the GH repo :+1: