Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Problem reading log4js config #10

Open
khwerhahn opened this issue Jan 7, 2017 · 0 comments
Open

Error: Problem reading log4js config #10

khwerhahn opened this issue Jan 7, 2017 · 0 comments

Comments

@khwerhahn
Copy link

Hi,

I get an error about reading the log4js config. Here is my setup. What seems to be the problem?

const log4js = require('log4js');
const logstashConnectFormatter = require('log4js-elasticsearch').logstashConnectFormatter;


module.exports = function(app) {
  const ES_CONNECTION = app.get('elasticsearch');
  
   log4js.configure({
    "appenders": [
      {
        "type": "log4js-elasticsearch",
        "buffersize": 1,
        "esclient": ES_CONNECTION,
        "layout": { type: 'logstash' }
      }
    ]
  });

  var logger = log4js.getLogger('express');
  var connectLogger = log4js.connectLogger(logger, { format: logstashConnectFormatter });

  return function(){
    app.use(connectLogger); 
  }

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant