# "can't convert Logger::Syslog into String" when configuring syslog

**URL:** <https://discourse.chef.io/t/cant-convert-logger-syslog-into-string-when-configuring-syslog/6039>\
**Category:** Chef Infra (archive)\
**Created:** [December 8, 2014, 7:54pm UTC](https://discourse.chef.io/t/cant-convert-logger-syslog-into-string-when-configuring-syslog/6039 "2014-12-08T19:54:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Jimenez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/william_jimenez/32/181_2.png) [@William\_Jimenez](https://discourse.chef.io/u/William_Jimenez)\
**Post date:** [December 8, 2014, 7:54pm UTC](https://discourse.chef.io/t/cant-convert-logger-syslog-into-string-when-configuring-syslog/6039/1 "2014-12-08T19:54:37Z")

</div>

Hello  
I’m trying to configure chef-client to log to syslog, as mentioned here:  
[https://github.com/opscode-cookbooks/chef-client#configuration-includes](https://github.com/opscode-cookbooks/chef-client#configuration-includes),  
however when I use that config I get the following error:

[2014-12-08T19:43:54+00:00] FATAL: Failed to open or create log file at #  
Logger::Syslog:0x00000002ee6e50: TypeError (can’t convert Logger::Syslog  
into String)  
[2014-12-08T19:43:54+00:00] FATAL: Aborting due to invalid 'log\_location’  
configuration

I’m wondering what environments this works on. I’m running chef  
client 11.16.4.

Thanks,  
William

---

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [December 9, 2014, 2:49am UTC](https://discourse.chef.io/t/cant-convert-logger-syslog-into-string-when-configuring-syslog/6039/2 "2014-12-09T02:49:47Z")

</div>

On 12/8/2014 2:54 PM, William Jimenez wrote:

> Hello  
> I'm trying to configure chef-client to log to syslog, as mentioned  
> here: [GitHub - chef-boneyard/chef-client: Development repository for Chef Client cookbook](https://github.com/opscode-cookbooks/chef-client#configuration-includes),  
> however when I use that config I get the following error:
> 
> [2014-12-08T19:43:54+00:00] FATAL: Failed to open or create log file at #  
> Logger::Syslog:0x00000002ee6e50: TypeError (can't convert  
> Logger::Syslog into String)  
> [2014-12-08T19:43:54+00:00] FATAL: Aborting due to invalid  
> 'log\_location' configuration
> 
> I'm wondering what environments this works on. I'm running chef  
> client 11.16.4.

William, maybe try this:

[https://supermarket.chef.io/cookbooks/chef-client\_syslog](https://supermarket.chef.io/cookbooks/chef-client_syslog)

My last comment at this epic blog post of mine is at the top:

"UPDATE: THE FOLLOWING BLOG POST IS KEPT FOR HISTORICAL PURPOSES ONLY.  
The solution at the end of the post no longer works and I give up  
chasing this elusive dream. Readers may want to look into this instead:  
[chef-client\_syslog versions](https://supermarket.getchef.com/cookbooks/chef-client_syslog)"

--  
Jeff Blaine  
[kickflop.net](http://kickflop.net)  
PGP/GnuPG Key ID: 0x0C8EDD02

---

<div class="post-metadata">

**Author:** ![jdunn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jdunn/32/1800_2.png) [@jdunn](https://discourse.chef.io/u/jdunn)\
**Post date:** [December 10, 2014, 6:29am UTC](https://discourse.chef.io/t/cant-convert-logger-syslog-into-string-when-configuring-syslog/6039/3 "2014-12-10T06:29:37Z")

</div>

On Mon, 8 Dec 2014, Jeff Blaine wrote:

> On 12/8/2014 2:54 PM, William Jimenez wrote:
> 
> > Hello  
> > I'm trying to configure chef-client to log to syslog, as mentioned  
> > here: [GitHub - chef-boneyard/chef-client: Development repository for Chef Client cookbook](https://github.com/opscode-cookbooks/chef-client#configuration-includes),  
> > however when I use that config I get the following error:
> > 
> > [2014-12-08T19:43:54+00:00] FATAL: Failed to open or create log file at #  
> > Logger::Syslog:0x00000002ee6e50: TypeError (can't convert  
> > Logger::Syslog into String)  
> > [2014-12-08T19:43:54+00:00] FATAL: Aborting due to invalid  
> > 'log\_location' configuration
> > 
> > I'm wondering what environments this works on. I'm running chef  
> > client 11.16.4.
> 
> William, maybe try this:
> 
> [chef-client\_syslog versions](https://supermarket.chef.io/cookbooks/chef-client_syslog)
> 
> My last comment at this epic blog post of mine is at the top:
> 
> "UPDATE: THE FOLLOWING BLOG POST IS KEPT FOR HISTORICAL PURPOSES ONLY.  
> The solution at the end of the post no longer works and I give up  
> chasing this elusive dream. Readers may want to look into this instead:  
> [chef-client\_syslog versions](https://supermarket.getchef.com/cookbooks/chef-client_syslog)"

I tried Scott Hain's configuration, and it works on Chef Client 12:

require 'syslog-logger'  
Chef::Log.use\_log\_devices( [Logger::Syslog.new("chef-client", Syslog::LOG\_LOCAL7)] )

Put that in /etc/chef/client.rb (after installing the syslog-logger gem  
into Chef's Ruby).

- Julian

[Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
[WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
[gopher://sdf.org/1/users/keymaker/ \* compliant!]  
[PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

---

<div class="post-metadata">

**Author:** ![William\_Jimenez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/william_jimenez/32/181_2.png) [@William\_Jimenez](https://discourse.chef.io/u/William_Jimenez)\
**Post date:** [December 12, 2014, 6:25am UTC](https://discourse.chef.io/t/cant-convert-logger-syslog-into-string-when-configuring-syslog/6039/4 "2014-12-12T06:25:40Z")

</div>

Thanks guys. I tried Krzysztof's 1st example from the gist and that seems  
to work. Jeff, I did see that cookbook earlier but I was trying to  
minimize dependencies at the moment.

-William

On Tue, Dec 9, 2014 at 10:29 PM, Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) wrote:

> On Mon, 8 Dec 2014, Jeff Blaine wrote:
> 
> On 12/8/2014 2:54 PM, William Jimenez wrote:
> 
> > > Hello  
> > > I'm trying to configure chef-client to log to syslog, as mentioned  
> > > here: [GitHub - chef-boneyard/chef-client: Development repository for Chef Client cookbook](https://github.com/opscode-cookbooks/chef-client#)  
> > > configuration-includes,  
> > > however when I use that config I get the following error:
> > > 
> > > [2014-12-08T19:43:54+00:00] FATAL: Failed to open or create log file at #  
> > > Logger::Syslog:0x00000002ee6e50: TypeError (can't convert  
> > > Logger::Syslog into String)  
> > > [2014-12-08T19:43:54+00:00] FATAL: Aborting due to invalid  
> > > 'log\_location' configuration
> > > 
> > > I'm wondering what environments this works on. I'm running chef  
> > > client 11.16.4.
> > 
> > William, maybe try this:
> > 
> > [chef-client\_syslog versions](https://supermarket.chef.io/cookbooks/chef-client_syslog)
> > 
> > My last comment at this epic blog post of mine is at the top:
> > 
> > "UPDATE: THE FOLLOWING BLOG POST IS KEPT FOR HISTORICAL PURPOSES ONLY.  
> > The solution at the end of the post no longer works and I give up  
> > chasing this elusive dream. Readers may want to look into this instead:  
> > [chef-client\_syslog versions](https://supermarket.getchef.com/cookbooks/chef-client_syslog)"
> 
> I tried Scott Hain's configuration, and it works on Chef Client 12:
> 
> require 'syslog-logger'  
> Chef::Log.use\_log\_devices( [ Logger::Syslog.new("chef-client",  
> Syslog::LOG\_LOCAL7) ] )
> 
> Put that in /etc/chef/client.rb (after installing the syslog-logger gem  
> into Chef's Ruby).
> 
> - Julian
> 
> [Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
> [WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
> [gopher://sdf.org/1/users/keymaker/ \* compliant!]  
> [PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

--  
William Jimenez  
Systems Engineer, Operations  
ItsOn, Inc.  
650-241-8470 {us/pacific}
