# Redirect logging to file; not syslog

**URL:** <https://discourse.sensu.io/t/redirect-logging-to-file-not-syslog/1981>\
**Category:** Sensu Go\
**Tags:** sensu-go\
**Created:** [August 4, 2020, 1:42pm UTC](https://discourse.sensu.io/t/redirect-logging-to-file-not-syslog/1981 "2020-08-04T13:42:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdelaney](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@mdelaney](https://discourse.sensu.io/u/mdelaney)\
**Post date:** [August 4, 2020, 1:42pm UTC](https://discourse.sensu.io/t/redirect-logging-to-file-not-syslog/1981/1 "2020-08-04T13:42:46Z")

</div>

All,

I’m trying to find a way to have sensu-go (specifically the [sensu agent](https://docs.sensu.io/sensu-go/latest/reference/agent/)) to log to it’s own file and not log to syslog.

Has anyone been able to do something like this?

- Mike D.

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [August 4, 2020, 6:00pm UTC](https://discourse.sensu.io/t/redirect-logging-to-file-not-syslog/1981/2 "2020-08-04T18:00:23Z")

</div>

Hey,  
what host OS are you running sensu-agent on?

If you are using something like Centos 6 as the host OS, you should already be using a sysvinit script that is configured to create logs in /var/log/sensu/

If you are running a systemd based linux distro (ex: CentOS 7), you can extend the systemd service definition and instruct systemd to redirect stdout and stderr into a log file of your cholce.

Here’s a recent discourse post that details how to reconfigure your systemd to redirect stdout/stderr to a log file: [SensuGO Agent and Backend Logging](https://discourse.sensu.io/t/sensugo-agent-and-backend-logging/1928/2)
