[chef] Re: RE: Trying to capture output


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: RE: Trying to capture output
  • Date: Fri, 12 Oct 2012 17:04:29 -0700


On Friday, October 12, 2012 at 12:34 PM, Matt Ray wrote:

Not sure why the console output isn't being captured, perhaps it's a bug? What version of Chef are you using?

If you're looking to capture it to some alternate format, here's a thread that touches on using syslog and splunk for capture chef-client output. 
http://comments.gmane.org/gmane.comp.sysutils.chef.user/891

Thanks,
Matt Ray
Senior Technical Evangelist | Opscode Inc.
Twitter, IRC, GitHub: mattray

From: Michael Glenney [ "> ]
Sent: Friday, October 12, 2012 2:13 PM
To: ">
Subject: [chef] Trying to capture output

We have our chef-client setup in client.rb to send the log to a log file.  And we have 'verbose_logging true' so that the output also goes to the console.  I need to capture that console output and I can't seem to do it.  That leads me to believe that when chef is teeing that output it's not sending the 2nd stream to STDOUT.  Otherwise I'd be able to capture it with a simple 'chef-client > chefout'

Any idea how chef is able to send that to my console without using STDOUT?  If I knew I might be able to figure out how to capture it.  I don't know how to find that in the code but if someone could point me to it I might be able to figure it out.

Or, if you just have the answer or know how to capture it you could just tell me and that'd be ok too :)

MG
The meaning of verbose_logging changed, it no longer forces extra logging to STDOUT. Before Chef 10.14, Chef auto detects a TTY and outputs to STDOUT. Redirecting the output changes STDOUT so that it's not a TTY and disables the secondary logger.

After Chef 10.14, there's only a single destination for log output so you can send the logger to a file and get formatted output on STDOUT.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§