kLezer
kLezer

Reputation: 221

How do I add the date to the log file name with newsyslog?

The name of the current log file is access.log.0.gz and it's a bit pointless. I want to do something more like 20160205.access.log.gz

how can I do that ?

I use the following newsyslog configuration

# logfilename              [owner:group]   mode    count size      when    flags   [/pid_file]               [sig_num]
/var/log/squid/access.log   squid:squid     644     14       *      @T00     ZB      /var/run/squid/squid.pid       30

Upvotes: 2

Views: 421

Answers (1)

arved
arved

Reputation: 4576

checkout the newsyslog manpage. The "-t" argument seems to do what you want

Upvotes: 2

Related Questions