# Error when running logstash

**URL:** <https://discuss.elastic.co/t/error-when-running-logstash/86888>\
**Category:** Logstash\
**Created:** [May 24, 2017, 2:50am UTC](https://discuss.elastic.co/t/error-when-running-logstash/86888 "2017-05-24T02:50:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shane\_lee](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@shane\_lee](https://discuss.elastic.co/u/shane_lee)\
**Post date:** [May 24, 2017, 2:50am UTC](https://discuss.elastic.co/t/error-when-running-logstash/86888/1 "2017-05-24T02:50:19Z")

</div>

Hi,

I am trying to simply execute logstash via child process in node js.  
It keeps exiting due to error with log4j

`ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.`

Sample logic is:

```
const indexPostalAddress = () => {
  exec('logstash-5.4.0/bin/logstash --path.settings=logstash-5.4.0/config -f logstash-csv-local.conf --verbose --debug',
   (error, stdout, stderr) => {
     if (error) {
       winston.error(`exec error: ${error}`);
       winston.error(`error code: ${error.code}`);
       return;
     }
     winston.log(`stdout: ${stdout}`);
     winston.log(`stderr: ${stderr}`);
   });
};

```

Even when I specify the location of the config dir I get this error.  
I assumed if you are using the logstash installation, it would pick up the log4j file inside config dir automatically?

Logstash 5.4.0

Thanks,  
Shane.

---

<div class="post-metadata">

**Author:** ![shane\_lee](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@shane\_lee](https://discuss.elastic.co/u/shane_lee)\
**Post date:** [May 24, 2017, 4:37am UTC](https://discuss.elastic.co/t/error-when-running-logstash/86888/2 "2017-05-24T04:37:54Z")

</div>

All good. Got it working using spawn

> const ls = spawn(`${logstashBinary}`, ['--log.level', 'info', '-f', `${logstashConf}`]);

---

<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:** [June 21, 2017, 4:37am UTC](https://discuss.elastic.co/t/error-when-running-logstash/86888/3 "2017-06-21T04:37:56Z")

</div>

Closed on June 21, 2017, 4:37am UTC

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