# Changing Log location from console to file

**URL:** <https://discuss.elastic.co/t/changing-log-location-from-console-to-file/102976>\
**Category:** Logstash\
**Created:** [October 6, 2017, 8:43am UTC](https://discuss.elastic.co/t/changing-log-location-from-console-to-file/102976 "2017-10-06T08:43:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zama\_Las](https://avatars.discourse-cdn.com/v4/letter/z/bb73d2/32.png) [@Zama\_Las](https://discuss.elastic.co/u/Zama_Las)\
**Post date:** [October 6, 2017, 8:43am UTC](https://discuss.elastic.co/t/changing-log-location-from-console-to-file/102976/1 "2017-10-06T08:43:57Z")

</div>

I have installed logstash using docker. It is running fine. It seems by default in docker installation, log output goes to console. I want that log output should go to file too along with console.

For this I added the below config items to my logstash log4j.properties file

appender.file.type = File  
[appender.file.name](http://appender.file.name) = LOGFILE  
appender.file.fileName = /usr/share/logstash/logs/logstash.log  
appender.file.layout.type = PatternLayout  
appender.file.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %m%n  
After that I restarted docker containing logstash using below command

docker restart logstash

But logs are not getting written to log file. It is still going to console. What else I am missing . Also , how to identify the console log file  
Any help will be highly appreciated.

---

<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:** [November 3, 2017, 8:44am UTC](https://discuss.elastic.co/t/changing-log-location-from-console-to-file/102976/2 "2017-11-03T08:44:12Z")

</div>

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