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


#1

Hello
I’m trying to configure chef-client to log to syslog, as mentioned here:
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


#2

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: 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

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:
https://supermarket.getchef.com/cookbooks/chef-client_syslog


Jeff Blaine
kickflop.net
PGP/GnuPG Key ID: 0x0C8EDD02


#3

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: 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

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:
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 * Sorry, I’m ]
[ WWW: 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 ]


#4

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 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: 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

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:
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 * Sorry, I’m ]
[ WWW: 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}