Logging to a queue


#1

Is it possible to extend the logger to write to a queue? Need a way to write to
different location than a file for real time notification.
Any pointers will be appreciated.


#2

If you use Chef 10.14 beta, you can hook in to the event dispatch system:

https://github.com/opscode/chef/blob/master/chef/lib/chef/event_dispatch/base.rb
https://github.com/opscode/chef/blob/master/chef/lib/chef/formatters/base.rb
https://github.com/opscode/chef/blob/master/chef/lib/chef/formatters/doc.rb

As you can see from above, this is how the new formatted output and error inspection stuff gets informed about things that happen in a chef run.

This is probably the best way to go for the long term. I’d also like feedback about the API and if there’s anything you want to do that’s difficult or impossible with it.

Of course, this entails writing a bit of code yourself, there may be quicker ways to get a solution…


Dan DeLeo

On Friday, July 20, 2012 at 3:04 PM, vin4gud@gmail.com wrote:

Is it possible to extend the logger to write to a queue? Need a way to write to
different location than a file for real time notification.
Any pointers will be appreciated.