RE: [chef] Re: Timestamp during chef-client run?

Hi Jubal,

Not exactly what you asked for but, I’ve been able to configure my chef client configuration to set up a /var/log/chef directory and then put all client run logs into that directory.

The code looks like this….

mypath = "/var/log/chef"
if ! FileTest::directory?(mypath)
mylog = “client-” +date +%F-%T.chomp + ".log"
log_location “#{mypath}/#{mylog}”

Just place this before the standard client.rb configuration lines and be sure to remove the redundant log_location line (if you have one)
I’ve used this since 11.1.x clients and it’s been working fine with 12.4.x clients as well.

Hope this helps.