#1

Hello All,

I want to set chef_client log_level to Info while bootstrapping. Right now
i see it is set to :auto in client.rb.

I believe client.rb is pushed from chef-server to client right ? What
config files on chef-server needs to be modified for changing the default
log_level ?

*root@controller:/etc# chef-client -v
Chef: 11.4.4

root@controller:/etc# cat chef/client.rb **
log_level :auto
log_location STDOUT
**chef_server_url "https://chefserver.nvsd.com/"https://chefserver.nvsd.com/
**
validation_client_name “chef-validator”
*node_name "controllernode.nvsd.com

Thanks in advance.
Shyam


#2

Do “chef-client --help” and look for log level. I believe is “–loglevel info”.

That way you set the option at run time.

Regards,


A bug magnet

On Sep 10, 2013, at 5:46, Shyam Goud informshyamgoud@gmail.com wrote:

Hello All,

I want to set chef_client log_level to Info while bootstrapping. Right now i see it is set to :auto in client.rb.

I believe client.rb is pushed from chef-server to client right ? What config files on chef-server needs to be modified for changing the default log_level ?
root@controller:/etc# chef-client -v
Chef: 11.4.4

root@controller:/etc# cat chef/client.rb
log_level :auto
log_location STDOUT
chef_server_url "https://chefserver.nvsd.com/"
validation_client_name "chef-validator"
node_name "controllernode.nvsd.com
Thanks in advance.
Shyam


#3

Thanks for the reply Luis.

“chef-client --log-level info” needs to be run from Client Machine
(Bootstrapped Machine) ?

I want to see the detailed execution logs while bootstrapping from
workstation, right now it seems the log_level is auto in 11.4.4 ( which is
converted as “WARN” ).
While bootstrapping is there any way i can see the chef logs like
"–log-level: info"

Regards,
Shyam

On Tue, Sep 10, 2013 at 4:31 PM, Luis Mondesi lemsx1@gmail.com wrote:

Do “chef-client --help” and look for log level. I believe is “–loglevel
info”.

That way you set the option at run time.

Regards,


A bug magnet

On Sep 10, 2013, at 5:46, Shyam Goud informshyamgoud@gmail.com wrote:

Hello All,

I want to set chef_client log_level to Info while bootstrapping. Right now
i see it is set to :auto in client.rb.

I believe client.rb is pushed from chef-server to client right ? What
config files on chef-server needs to be modified for changing the default
log_level ?

*root@controller:/etc# chef-client -v
Chef: 11.4.4

root@controller:/etc# cat chef/client.rb **
log_level :auto
log_location STDOUT
**chef_server_url "https://chefserver.nvsd.com/"https://chefserver.nvsd.com/
**
validation_client_name “chef-validator”
*node_name "controllernode.nvsd.com

Thanks in advance.
Shyam


#4

If its only a one time thing, why don’t just use --log-level debug?


A bug magnet

On Sep 10, 2013, at 7:17, Shyam Goud informshyamgoud@gmail.com wrote:

Thanks for the reply Luis.

“chef-client --log-level info” needs to be run from Client Machine (Bootstrapped Machine) ?

I want to see the detailed execution logs while bootstrapping from workstation, right now it seems the log_level is auto in 11.4.4 ( which is converted as “WARN” ).
While bootstrapping is there any way i can see the chef logs like “–log-level: info”

Regards,
Shyam

On Tue, Sep 10, 2013 at 4:31 PM, Luis Mondesi lemsx1@gmail.com wrote:

Do “chef-client --help” and look for log level. I believe is “–loglevel info”.

That way you set the option at run time.

Regards,


A bug magnet

On Sep 10, 2013, at 5:46, Shyam Goud informshyamgoud@gmail.com wrote:

Hello All,

I want to set chef_client log_level to Info while bootstrapping. Right now i see it is set to :auto in client.rb.

I believe client.rb is pushed from chef-server to client right ? What config files on chef-server needs to be modified for changing the default log_level ?
root@controller:/etc# chef-client -v
Chef: 11.4.4

root@controller:/etc# cat chef/client.rb
log_level :auto
log_location STDOUT
chef_server_url "https://chefserver.nvsd.com/"
validation_client_name "chef-validator"
node_name "controllernode.nvsd.com
Thanks in advance.
Shyam


#5

Hi Shyam

With knife bootstrap there is no option to set log level. I don’t see why it would default to ‘WARN’ though…
You could alway edit /opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/knife/core/bootstrap_context.rb on your server, but I would not recommend it.

Kr,
Steven

On 10 Sep 2013, at 13:17, Shyam Goud informshyamgoud@gmail.com wrote:

Thanks for the reply Luis.

“chef-client --log-level info” needs to be run from Client Machine (Bootstrapped Machine) ?

I want to see the detailed execution logs while bootstrapping from workstation, right now it seems the log_level is auto in 11.4.4 ( which is converted as “WARN” ).
While bootstrapping is there any way i can see the chef logs like “–log-level: info”

Regards,
Shyam

On Tue, Sep 10, 2013 at 4:31 PM, Luis Mondesi lemsx1@gmail.com wrote:
Do “chef-client --help” and look for log level. I believe is “–loglevel info”.

That way you set the option at run time.

Regards,


A bug magnet

On Sep 10, 2013, at 5:46, Shyam Goud informshyamgoud@gmail.com wrote:

Hello All,

I want to set chef_client log_level to Info while bootstrapping. Right now i see it is set to :auto in client.rb.

I believe client.rb is pushed from chef-server to client right ? What config files on chef-server needs to be modified for changing the default log_level ?
root@controller:/etc# chef-client -v
Chef: 11.4.4

root@controller:/etc# cat chef/client.rb
log_level :auto
log_location STDOUT
chef_server_url "https://chefserver.nvsd.com/"
validation_client_name "chef-validator"
node_name "controllernode.nvsd.com
Thanks in advance.
Shyam


#6

Thanks for the reply Steven,

I did that too… on my chef-server

/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/knife/core/bootstrap_context.rb
*---- snip -------------
*
def config_content
client_rb = <<-CONFIG
log_level :info
log_location STDOUT
chef_server_url "#{@chef_config[:chef_server_url]}"
validation_client_name “#{@chef_config[:validation_client_name]}”
-----------------------

But still client.rb on bootstrapped machine shows as
*
root@controller:/etc# cat chef/client.rb
log_level :auto
log_location STDOUT
chef_server_url "https://chefserver.nvsd.com/"
validation_client_name "chef-validator"
node_name “controllernode.nvsd.com

root@controller:/etc#*

Regards,
Shyam.

On Tue, Sep 10, 2013 at 5:24 PM, Steven De Coeyer steven@banteng.be wrote:

Hi Shyam

With knife bootstrap there is no option to set log level. I don’t see why
it would default to ‘WARN’ though…
You could alway
edit /opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/knife/core/bootstrap_context.rb
on your server, but I would not recommend it.

Kr,
Steven

On 10 Sep 2013, at 13:17, Shyam Goud informshyamgoud@gmail.com wrote:

Thanks for the reply Luis.

“chef-client --log-level info” needs to be run from Client Machine
(Bootstrapped Machine) ?

I want to see the detailed execution logs while bootstrapping from
workstation, right now it seems the log_level is auto in 11.4.4 ( which is
converted as “WARN” ).
While bootstrapping is there any way i can see the chef logs like
"–log-level: info"

Regards,
Shyam

On Tue, Sep 10, 2013 at 4:31 PM, Luis Mondesi lemsx1@gmail.com wrote:

Do “chef-client --help” and look for log level. I believe is “–loglevel
info”.

That way you set the option at run time.

Regards,


A bug magnet

On Sep 10, 2013, at 5:46, Shyam Goud informshyamgoud@gmail.com wrote:

Hello All,

I want to set chef_client log_level to Info while bootstrapping. Right
now i see it is set to :auto in client.rb.

I believe client.rb is pushed from chef-server to client right ? What
config files on chef-server needs to be modified for changing the default
log_level ?

*root@controller:/etc# chef-client -v
Chef: 11.4.4

root@controller:/etc# cat chef/client.rb **
log_level :auto
log_location STDOUT
**chef_server_url "https://chefserver.nvsd.com/"https://chefserver.nvsd.com/
**
validation_client_name “chef-validator”
*node_name "controllernode.nvsd.com

Thanks in advance.
Shyam


#7

On Tuesday, September 10, 2013 at 5:13 AM, Shyam Goud wrote:

Thanks for the reply Steven,

I did that too… on my chef-server

/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/knife/core/bootstrap_context.rb
---- snip -------------
def config_content
client_rb = <<-CONFIG
log_level :info
log_location STDOUT
chef_server_url "#{@chef_config[:chef_server_url]}"
validation_client_name “#{@chef_config[:validation_client_name]}”

But still client.rb on bootstrapped machine shows as

root@controller:/etc# cat chef/client.rb
log_level :auto
log_location STDOUT
chef_server_url "https://chefserver.nvsd.com/"
validation_client_name "chef-validator"
node_name “controllernode.nvsd.com (http://controllernode.nvsd.com)”

root@controller:/etc#

Regards,
Shyam.

You need to do any hacking on the box you run knife bootstrap from. This won’t affect any already-bootstrapped machines (though you can manage those with the chef-client cookbook to your liking).

Take a look at bootstrap templates for customizing the config on the bootstrapped machine:

http://docs.opscode.com/knife_bootstrap.html