# How to get all chef log into a file?

**URL:** <https://discourse.chef.io/t/how-to-get-all-chef-log-into-a-file/11677>\
**Category:** Chef Infra (archive)\
**Created:** [October 2, 2017, 7:15pm UTC](https://discourse.chef.io/t/how-to-get-all-chef-log-into-a-file/11677 "2017-10-02T19:15:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankur760](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Ankur760](https://discourse.chef.io/u/Ankur760)\
**Post date:** [October 2, 2017, 7:15pm UTC](https://discourse.chef.io/t/how-to-get-all-chef-log-into-a-file/11677/1 "2017-10-02T19:15:33Z")

</div>

How can i get all the chef client run log of a node into a txt or any file?

---

<div class="post-metadata">

**Author:** ![simark](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/simark/32/2099_2.png) [@simark](https://discourse.chef.io/u/simark)\
**Post date:** [October 2, 2017, 7:43pm UTC](https://discourse.chef.io/t/how-to-get-all-chef-log-into-a-file/11677/2 "2017-10-02T19:43:12Z")

</div>

You could use `--log_level` and `--logfile`  
[https://docs.chef.io/ctl\_chef\_client.html](https://docs.chef.io/ctl_chef_client.html)

---

<div class="post-metadata">

**Author:** ![petike](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@petike](https://discourse.chef.io/u/petike)\
**Post date:** [October 3, 2017, 1:36pm UTC](https://discourse.chef.io/t/how-to-get-all-chef-log-into-a-file/11677/3 "2017-10-03T13:36:57Z")

</div>

You can edit the /etc/chef/client.rb and set the line log\_location to your desired values. You can use syslog, windows event logger, and simple log files as well.

[https://docs.chef.io/config\_rb\_client.html](https://docs.chef.io/config_rb_client.html)

---

<div class="post-metadata">

**Author:** ![Ankur760](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Ankur760](https://discourse.chef.io/u/Ankur760)\
**Post date:** [October 3, 2017, 5:45pm UTC](https://discourse.chef.io/t/how-to-get-all-chef-log-into-a-file/11677/4 "2017-10-03T17:45:02Z")

</div>

I am working on windows . Is their any code you can suggest
