# Chef-client Log File Resource

**URL:** <https://discourse.chef.io/t/chef-client-log-file-resource/8833>\
**Category:** Chef Infra (archive)\
**Created:** [July 1, 2016, 10:05pm UTC](https://discourse.chef.io/t/chef-client-log-file-resource/8833 "2016-07-01T22:05:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcderose](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jcderose/32/1149_2.png) [@jcderose](https://discourse.chef.io/u/jcderose)\
**Post date:** [July 1, 2016, 10:05pm UTC](https://discourse.chef.io/t/chef-client-log-file-resource/8833/1 "2016-07-01T22:05:36Z")

</div>

My end goal: log the chef-client runs to file (rather than just STDOUT).

I found the `chef-client::config` recipe and the `default['chef_client']['cron']['log_file']` attribute. When I include the `chef-client::config` recipe in my test kitchen instance, test kitchen creates a `/etc/chef/client.rb` file different than what I currently have in my non-dev environments (which created the `/etc/chef/client.rb` file with the standard chef-client install but not from `chef-client::config`).

non-dev environment `/etc/chef/client.rb` file:

```auto
chef_server_url "https://path/to/server"
validation_client_name "my-custom-name"
node_name "my-custom-node-name"
trusted_certs_dir "/etc/chef/trusted_certs"

```

dev environment `/etc/chef/client.rb`:

```auto
chef_server_url "chefzero://localhost:8889"
client_fork true
log_location "/var/log/chef/client.log"
validation_client_name "chef-validator"
verify_api_cert true
node_name "default-ubuntu-1404"

# Do no crash if a handler is missing / not installed yet
begin
  rescue NameError => e
  Chef::Log.error e
end

Dir.glob(File.join("/etc/chef", "client.d", "*.rb")).each do |conf|
  Chef::Config.from_file(conf)
end

```

My question: is there an easier way to add the `log_location` variable to my `client.rb` file than this recipe/attribute? I assume that if I choose to manage the `log_location` attribute via the `chef-client::config` recipe, I have to manage the other attributes via this recipe too (`chef_server_url`, `validation_client_name`, etc.) or they’ll be removed from my pre-existing `client.rb` files.

I’m running chef-client v 12.5.1.
