# Inspec log file location

**URL:** <https://discourse.chef.io/t/inspec-log-file-location/11650>\
**Category:** Chef InSpec\
**Created:** [September 28, 2017, 2:19pm UTC](https://discourse.chef.io/t/inspec-log-file-location/11650 "2017-09-28T14:19:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkeshark](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@bkeshark](https://discourse.chef.io/u/bkeshark)\
**Post date:** [September 28, 2017, 2:19pm UTC](https://discourse.chef.io/t/inspec-log-file-location/11650/1 "2017-09-28T14:19:14Z")

</div>

Hi All,  
we are running inspec exec profile on node and getting the result on same on but we want to capture that profile result logs and send to centralize logging system.

any idea if we can specify the log file location to capture inspec profile results?

---

<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:** [September 28, 2017, 7:21pm UTC](https://discourse.chef.io/t/inspec-log-file-location/11650/2 "2017-09-28T19:21:08Z")

</div>

Parsing the result to json and then simply redirect the output to your desired destination  
`inspec exec ... --format=json >> desired_path`

---

<div class="post-metadata">

**Author:** ![bkeshark](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@bkeshark](https://discourse.chef.io/u/bkeshark)\
**Post date:** [September 28, 2017, 9:35pm UTC](https://discourse.chef.io/t/inspec-log-file-location/11650/3 "2017-09-28T21:35:53Z")

</div>

Thanks Simark.  
i was looking for any configuration where log location can be set.  
inspec does provided --log-location flag and i have tried to use in below format.  
"inspec exec --log-location /data/inspec.log wrapper-profile/"  
even though inspec.log file gets created after inspec exec but does not output the results.

cat /data/inspec.log  
"# Logfile created on 2017-09-29 07:32:10 +1000 by logger.rb/54362"

---

<div class="post-metadata">

**Author:** ![yarick](https://avatars.discourse-cdn.com/v4/letter/y/c5a1d2/32.png) [@yarick](https://discourse.chef.io/u/yarick)\
**Post date:** [October 9, 2017, 6:39pm UTC](https://discourse.chef.io/t/inspec-log-file-location/11650/4 "2017-10-09T18:39:43Z")

</div>

bkeshark,  
I am not a huge expect on this. But the way I understood this switch is that it is only for Diagnostic Messages.

```auto
[--log-location=LOG_LOCATION] # Location to send diagnostic log messages to. (default: STDOUT or STDERR)

```
