11.6 Appears to Break Logging to Syslog?

Hi Folks,

Receiving the following error when bootstrapping with 11.6

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/monologger.rb:69:in
exist?': can't convert Syslog::Logger into String (TypeError) from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/monologger.rb:69:inopen_logfile’
[…]
from
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/bin/chef-client:26:in
<top (required)>' from /usr/bin/chef-client:23:inload’
from /usr/bin/chef-client:23:in `’

I believe this was introduced by
https://github.com/opscode/chef/commit/43d01dcc6bfc44571d72a2e9bc4f32524f547ea7-
adding MonoLogger to resolve
http://tickets.opscode.com/browse/CHEF-3935

This breaks the solution at
http://lists.opscode.com/sympa/arc/chef/2013-01/msg00037.html, and
presumably also https://github.com/higanworks-cookbooks/chef-client_syslog,
http://tickets.opscode.com/browse/CHEF-273 ,
http://tickets.opscode.com/browse/COOK-2326 , etc.

Recommend adding a new attribute rather than continuing to overload
log_location.

Anyone have a workaround?

Best,
Alastair

On Fri, Aug 23, 2013 at 8:47 PM, Alastair Firth alfirth@gmail.com wrote:

I believe this was introduced by
Merge branch 'CHEF-3935' · chef/chef@43d01dc · GitHub

This breaks the solution at
chef - [chef] RE: Re: RE: Re: Logging chef-client activity to syslog - how?, and
presumably also GitHub - higanworks-cookbooks/chef-client_syslog: send chef-client logs to syslog. ,
http://tickets.opscode.com/browse/CHEF-273 ,
http://tickets.opscode.com/browse/COOK-2326 , etc.

Recommend adding a new attribute rather than continuing to overload
log_location.

Anyone have a workaround?

Hi,

You need to make sure whatever log replacement instance you give as an
argument to log_location implements a #write(message) and a #close
method, otherwise chef will think the argument is a file path.

We are successfully using this implementation (slightly simplified):
syslog_logger/lib/syslog-logger.rb at master · ngmoco/syslog_logger · GitHub.
We just had to add an empty #close method and a dummy #write(message)
method, that calls #info(message).

--
Eric-Olivier Lamey