log2elasticsearch
v1.0.1
Published
Send nodejs logs to elasticsearch.
Downloads
4
Readme
es-logger
Logger to send log messages to elasticsearch.
how to use
in package.json
"dependencies": {
"log2elasticsearch": "^1.0.1"
}
configuration file logger.js
import createLogger from 'log2elasticsearch'
export var logger = createLogger(
{
"application":"company-website-frontend",
// "host":"https://search-application-logs-<elasticsearch id>.eu-central-1.es.amazonaws.com/"
"host":"http://localhost:9200"
}
)
Then you can log with
import {logger} from './logger'
logger.error(new Error("bad things happen to good people"));
logger.info("good things come to those who wait");