# Logstash not logging

**URL:** <https://discuss.elastic.co/t/logstash-not-logging/75254>\
**Category:** Logstash\
**Created:** [February 15, 2017, 11:28pm UTC](https://discuss.elastic.co/t/logstash-not-logging/75254 "2017-02-15T23:28:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![timmy8ken](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@timmy8ken](https://discuss.elastic.co/u/timmy8ken)\
**Post date:** [February 15, 2017, 11:28pm UTC](https://discuss.elastic.co/t/logstash-not-logging/75254/1 "2017-02-15T23:28:15Z")

</div>

Hello,

I have Logstash 5.2.0 running on a Server 2016 server and I am trying to enable internal logging and I can't get it to write to a log file.

I have tried the following:

Edited logstash.yml with the following line:  
`path.logs: E:\ElasticStack\Logstash\logs\`

Ran the following commands from command prompt:

```
logstash -f config\logstash-test.conf --path.log "E:\ElasticStack\Logstash\logs\logstash.log" --config.reload.automatic
logstash -f config\logstash-test.conf -l "%LS_HOME%\logs\logstash.log" --config.reload.automatic
logstash -f config\logstash-test.conf --path.log "E:\ElasticStack\Logstash\logs\" --config.reload.automatic
logstash -f config\logstash-test.conf -l "%LS_HOME%\logs\" --config.reload.automatic
logstash -f config\logstash-test.conf --path.log "E:\ElasticStack\Logstash\logs\logstash.log" --config.reload.automatic
logstash -f config\logstash-test.conf --path.log "E:\ElasticStack\Logstash\logs\" --config.reload.automatic
logstash -f config\logstash-test.conf --path.logs:E:\ElasticStack\Logstash\logs\ --config.reload.automatic
logstash -f config\logstash-test.conf --path.logs:E:\ElasticStack\Logstash\logs\logstash.log --config.reload.automatic

```

None of these end up with Logstash writing to a log file. The last three commands return the following errors:

`ERROR: Unrecognised option '--path.logs:E:\ElasticStack\Logstash\logs\logstash.log'`

If I increase the log level (--log.level debug) then I can see all the dubug info, which is what I need, but I can't read it because there is too much, hence the reason I want it to go to a log file.

Can anyone see what I may be doing wrong?

Cheers,

Tim

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [February 16, 2017, 12:54am UTC](https://discuss.elastic.co/t/logstash-not-logging/75254/2 "2017-02-16T00:54:05Z")

</div>

Hi,

Can you try using:

```auto
path.logs: "E:\\ElasticStack\\Logstash\\logs"

```

In your logstash.yml.

---

<div class="post-metadata">

**Author:** ![timmy8ken](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@timmy8ken](https://discuss.elastic.co/u/timmy8ken)\
**Post date:** [February 16, 2017, 1:25am UTC](https://discuss.elastic.co/t/logstash-not-logging/75254/3 "2017-02-16T01:25:44Z")

</div>

Hi Mike,

I've tested that format and there was not difference, still no logs created.

Whilst at it I also tried the following:

```
path.logs: "E:\\ElasticStack\\Logstash\\logs\\"
path.logs: "E:\\ElasticStack\\Logstash\\logs\\logstash.log"
path.logs: 'E:\\ElasticStack\\Logstash\\logs'

```

and for fun, on the command line:

`logstash -f config\logstash.conf --path.logs E:\\ElasticStack\\Logstash\\logs\\ --config.reload.automatic`

All of these configurations allowed Logstash to start, however no log files.

Tim

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [February 16, 2017, 2:00am UTC](https://discuss.elastic.co/t/logstash-not-logging/75254/4 "2017-02-16T02:00:54Z")

</div>

Try adding:

SET JAVA\_OPTS=%JAVA\_OPTS% -Dlog4j.configurationFile=%LS\_HOME%\config\log4j2.properties

to bin\setup.bat in the Logstash directory. Refer to:

> <https://github.com/elastic/logstash/issues/6352>

  

> <https://stackoverflow.com/questions/40676294/logstash-cannot-find-log4j2-properties-file>

---

<div class="post-metadata">

**Author:** ![timmy8ken](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@timmy8ken](https://discuss.elastic.co/u/timmy8ken)\
**Post date:** [February 16, 2017, 3:37am UTC](https://discuss.elastic.co/t/logstash-not-logging/75254/5 "2017-02-16T03:37:51Z")

</div>

Thanks Mike,

That got me there in the end.

Adding the Java option got the log4j plugin working. The following command started Logstash and created logs:

`logstash -f config\logstash.conf --path.logs /E:/ElasticStack/Logstash/logs/ --config.reload.automatic`

I couldn't get logging working for the service, however it turned out I had the LS\_SETTINGS\_DIR environment variable set incorrectly. I had read [INFO: Windows, Logstash and could not find log4j2 configuration](https://discuss.elastic.co/t/info-windows-logstash-and-could-not-find-log4j2-configuration/67633) which suggested using the unix style for the path. I changed it to a Windows style and it picked up the logstash.yml config.

The configuration setting I used in the yml file was:

`path.logs: "//E://ElasticStack//Logstash//logs"`

Thanks for your help with this.

Tim

---

<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:** [March 16, 2017, 3:37am UTC](https://discuss.elastic.co/t/logstash-not-logging/75254/6 "2017-03-16T03:37:57Z")

</div>

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