Error when running logstash


(Shane Lee) #1

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.


(Shane Lee) #2

All good. Got it working using spawn

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


(system) #3

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