# Chef-solo and output formatters via config.rb?

**URL:** <https://discourse.chef.io/t/chef-solo-and-output-formatters-via-config-rb/4394>\
**Category:** Chef Infra (archive)\
**Created:** [August 6, 2013, 4:00pm UTC](https://discourse.chef.io/t/chef-solo-and-output-formatters-via-config-rb/4394 "2013-08-06T16:00:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torben\_Knerr](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@Torben\_Knerr](https://discourse.chef.io/u/Torben_Knerr)\
**Post date:** [August 6, 2013, 4:00pm UTC](https://discourse.chef.io/t/chef-solo-and-output-formatters-via-config-rb/4394/1 "2013-08-06T16:00:26Z")

</div>

Hi everybody,

I just noticed that setting the output formatter via solo.rb does not work:

```auto
log_level :warn
formatter "minimal"

```

When I run `chef-solo -j dna.json -c solo.rb` it picks up the correct  
log\_level from solo.rb but still uses the “doc” formatter.

Running `chef-solo -j dna.json -c solo.rb -F min` works though, so it seems  
it just does not pick it up from solo.rb…

This was observed on Chef 11.4.4 and Chef 11.6.0.

Is this a known bug?

Cheers, Torben

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [August 6, 2013, 4:07pm UTC](https://discourse.chef.io/t/chef-solo-and-output-formatters-via-config-rb/4394/2 "2013-08-06T16:07:47Z")

</div>

On Tuesday, August 6, 2013 at 9:00 AM, Torben Knerr wrote:

> Hi everybody,
> 
> I just noticed that setting the output formatter via solo.rb does not work:
> 
> ```auto
> log_level :warn
> formatter "minimal"
> 
> ```
> 
> When I run `chef-solo -j dna.json -c solo.rb` it picks up the correct log\_level from solo.rb but still uses the "doc" formatter.
> 
> Running `chef-solo -j dna.json -c solo.rb -F min` works though, so it seems it just does not pick it up from solo.rb...
> 
> This was observed on Chef 11.4.4 and Chef 11.6.0.
> 
> Is this a known bug?
> 
> Cheers, Torben  
> Use `add_formatter`. Chef has support for multiple formatters, so that you could hypothetically have one that prints user readable output to the screen while another prints machine parseable output to a file (or send data over the network to a centralized storage system or whatever). The configuration settings are pretty basic right now (you only can configure a formatter name and a file path), and I'm sure people will bump into limitations once they really start using it, but that's why it is this way.

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Torben\_Knerr](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@Torben\_Knerr](https://discourse.chef.io/u/Torben_Knerr)\
**Post date:** [August 6, 2013, 5:48pm UTC](https://discourse.chef.io/t/chef-solo-and-output-formatters-via-config-rb/4394/3 "2013-08-06T17:48:02Z")

</div>

Thanks, `add_formatter` works! 🙂

On Tue, Aug 6, 2013 at 6:07 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Tuesday, August 6, 2013 at 9:00 AM, Torben Knerr wrote:
> 
> Hi everybody,
> 
> I just noticed that setting the output formatter via solo.rb does not work:
> 
> ```auto
> log_level :warn
> formatter "minimal"
> 
> ```
> 
> When I run `chef-solo -j dna.json -c solo.rb` it picks up the correct  
> log\_level from solo.rb but still uses the "doc" formatter.
> 
> Running `chef-solo -j dna.json -c solo.rb -F min` works though, so it  
> seems it just does not pick it up from solo.rb...
> 
> This was observed on Chef 11.4.4 and Chef 11.6.0.
> 
> Is this a known bug?
> 
> Cheers, Torben
> 
> Use `add_formatter`. Chef has support for multiple formatters, so that  
> you could hypothetically have one that prints user readable output to the  
> screen while another prints machine parseable output to a file (or send  
> data over the network to a centralized storage system or whatever). The  
> configuration settings are pretty basic right now (you only can configure a  
> formatter name and a file path), and I'm sure people will bump into  
> limitations once they really start using it, but that's why it is this way.
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Torben\_Knerr](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@Torben\_Knerr](https://discourse.chef.io/u/Torben_Knerr)\
**Post date:** [August 6, 2013, 7:20pm UTC](https://discourse.chef.io/t/chef-solo-and-output-formatters-via-config-rb/4394/4 "2013-08-06T19:20:03Z")

</div>

Oh, is there a difference / inconsistency between chef-client and chef-solo?

@miketheman reports that `formatter` works with chef-client:

> <https://github.com/hashicorp/vagrant/pull/1250#issuecomment-22203385>
>
> I'm confused - formatter works for chef-client, but not chef-solo?

On Tue, Aug 6, 2013 at 7:48 PM, Torben Knerr [ukio@gmx.de](mailto:ukio@gmx.de) wrote:

> Thanks, `add_formatter` works! 🙂
> 
> On Tue, Aug 6, 2013 at 6:07 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> 
> > On Tuesday, August 6, 2013 at 9:00 AM, Torben Knerr wrote:
> > 
> > Hi everybody,
> > 
> > I just noticed that setting the output formatter via solo.rb does not  
> > work:
> > 
> > ```auto
> > log_level :warn
> > formatter "minimal"
> > 
> > ```
> > 
> > When I run `chef-solo -j dna.json -c solo.rb` it picks up the correct  
> > log\_level from solo.rb but still uses the "doc" formatter.
> > 
> > Running `chef-solo -j dna.json -c solo.rb -F min` works though, so it  
> > seems it just does not pick it up from solo.rb...
> > 
> > This was observed on Chef 11.4.4 and Chef 11.6.0.
> > 
> > Is this a known bug?
> > 
> > Cheers, Torben
> > 
> > Use `add_formatter`. Chef has support for multiple formatters, so that  
> > you could hypothetically have one that prints user readable output to the  
> > screen while another prints machine parseable output to a file (or send  
> > data over the network to a centralized storage system or whatever). The  
> > configuration settings are pretty basic right now (you only can configure a  
> > formatter name and a file path), and I'm sure people will bump into  
> > limitations once they really start using it, but that's why it is this way.
> > 
> > --  
> > Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [August 6, 2013, 8:03pm UTC](https://discourse.chef.io/t/chef-solo-and-output-formatters-via-config-rb/4394/5 "2013-08-06T20:03:39Z")

</div>

On Tuesday, August 6, 2013 at 12:20 PM, Torben Knerr wrote:

> Oh, is there a difference / inconsistency between chef-client and chef-solo?
> 
> @miketheman reports that `formatter` works with chef-client:  
> [Adds formatter option to Chef Provisioner by miketheman · Pull Request #1250 · hashicorp/vagrant · GitHub](https://github.com/mitchellh/vagrant/pull/1250#issuecomment-22203385)

Could be dependent on 10.x vs. 11.x, we made a few changes to the way this stuff is configured when formatters became the default in 11.0

--  
Daniel DeLeo
