Variable logging levels within a chef recipe

HI
In the client.rb the log level is set to info
When running a recipe, it inherits the above log level
I have a recipe which does say three things , for example
package "component"
file “somefile” do
end
service "component service"
When chef-client is copying the file from chef server to the node, it writes out the content of the file in the chef-client log.
I would like to suppress logging only for that part of the recipe from within the recipe.
Is it possible? Any pointers would be appreciated?
Regards
mg

With a file resource, just pass the attribute:

sensitive true

and Chef won't log the contents.

https://docs.chef.io/chef/resources.html#id106

On Fri, Jan 23, 2015 at 12:09 PM, M G meher03@hotmail.com wrote:

HI

In the client.rb the log level is set to info

When running a recipe, it inherits the above log level

I have a recipe which does say three things , for example

package "component"

file "somefile" do

end

service "component service"

When chef-client is copying the file from chef server to the node, it
writes out the content of the file in the chef-client log.

I would like to suppress logging only for that part of the recipe from
within the recipe.

Is it possible? Any pointers would be appreciated?

Regards

mg

--
Justin Dossey
Practice Owner
New Context Services, Inc

Thank You Justin.

Date: Fri, 23 Jan 2015 12:30:20 -0800
From: justin.dossey@newcontext.com
To: chef@lists.opscode.com
Subject: [chef] Re: Variable logging levels within a chef recipe

With a file resource, just pass the attribute:

sensitive true

and Chef won’t log the contents.

https://docs.chef.io/chef/resources.html#id106

On Fri, Jan 23, 2015 at 12:09 PM, M G meher03@hotmail.com wrote:

HI
In the client.rb the log level is set to info
When running a recipe, it inherits the above log level
I have a recipe which does say three things , for example
package "component"
file “somefile” do
end
service "component service"
When chef-client is copying the file from chef server to the node, it writes out the content of the file in the chef-client log.
I would like to suppress logging only for that part of the recipe from within the recipe.
Is it possible? Any pointers would be appreciated?
Regards
mg


Justin DosseyPractice OwnerNew Context Services, Inc