# How can I change the location of Logstash's logs?

**URL:** <https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992>\
**Category:** Logstash\
**Created:** [April 11, 2017, 1:58pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992 "2017-04-11T13:58:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dolanmk](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dolanmk](https://discuss.elastic.co/u/dolanmk)\
**Post date:** [April 11, 2017, 1:58pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/1 "2017-04-11T13:58:10Z")

</div>

Hi,

I am hoping to change the location of where Logstash stores the logs it creates of its own actions. As I understand it right now, this can be done with path.logs in the logstash.yml file. However, it doesn't seem as though I can't get the syntax correct. This is what I have right now and nothing is being generated in this location.

path.logs: "D:\apps\ELK2\logstash-5.3.0\logs"

Also, my ultimate goal would be for Logstash to recognize the current directory (where the yml file is located is fine) to store the logs so that this won't have to be user defined if moving to a different machine.

I apologize if any of this is unclear. Thank you for your help!

Miranda

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 11, 2017, 7:17pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/2 "2017-04-11T19:17:36Z")

</div>

path.logs is the correct setting. Are you using windows or Linux?

---

<div class="post-metadata">

**Author:** ![dolanmk](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dolanmk](https://discuss.elastic.co/u/dolanmk)\
**Post date:** [April 11, 2017, 7:29pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/3 "2017-04-11T19:29:16Z")

</div>

Thank you for responding! I am using a windows machine.

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 11, 2017, 7:45pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/4 "2017-04-11T19:45:25Z")

</div>

What happens if you specify it within the startup script?

./bin/elasticsearch -Epath.logs="C:\My Logs\logs"

---

<div class="post-metadata">

**Author:** ![dolanmk](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dolanmk](https://discuss.elastic.co/u/dolanmk)\
**Post date:** [April 11, 2017, 7:49pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/5 "2017-04-11T19:49:26Z")

</div>

I'm so sorry, I think you lost me. Are you saying to do this as a command line argument?

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 11, 2017, 8:43pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/6 "2017-04-11T20:43:36Z")

</div>

Yes, what happens if you specify the path.logs on the command line argument.

---

<div class="post-metadata">

**Author:** ![dolanmk](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dolanmk](https://discuss.elastic.co/u/dolanmk)\
**Post date:** [April 12, 2017, 12:30pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/7 "2017-04-12T12:30:12Z")

</div>

I used the following command:

`.\bin>logstash -f syslog.conf -l D:/apps/ELK2/logstash-5.3.0/logs`

Logstash worked perfectly fine but the internal logs were not sent to the directory I specified.

Also, when I did `logstash -h` to get the proper command for the path specification, the help message listed the default file (the path I set in logstash.yml) for the internal logs. This path is correct but nothing is actually being written here.

```
-l, --path.logs PATH Write logstash internal logs to the given
                              file. Without this flag, logstash will emit
                              logs to standard output.
                               (default: "D:/apps/ELK2/logstash-5.3.0/logs")
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 10, 2017, 12:33pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-location-of-logstashs-logs/81992/8 "2017-05-10T12:33:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
