[chef] Re: 11.6 Appears to Break Logging to Syslog?


Chronological Thread 
  • From: Eric-Olivier Lamey < >
  • To:
  • Subject: [chef] Re: 11.6 Appears to Break Logging to Syslog?
  • Date: Fri, 23 Aug 2013 21:37:40 +0200

On Fri, Aug 23, 2013 at 8:47 PM, Alastair Firth 
< >
 wrote:
> 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?

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):
https://github.com/ngmoco/syslog_logger/blob/master/lib/syslog-logger.rb.
We just had to add an empty #close method and a dummy #write(message)
method, that calls #info(message).

-- 
Eric-Olivier Lamey



Archive powered by MHonArc 2.6.16.

§