log4js-http
An appender for log4js-node which support an http logger middleware.
Note
Use request internally
Installation
$ npm i --save log4js-http
Usage
Config log4js-http is same as the original log4js-node.
Send log string to an http middleware
const log4js = log4js const logger = log4js logger
NB :
url is mandatory, headers are optionals.
headers need to be a key/value object.
ex: headers: {key1:value1,key2:value2}
Send custom log object to an http middleware
If you send objects, the log4js output formatting will be bypassed
const log4js = log4js const logger = log4js logger
object: true/false, if not present, log is considered to be a string.
addLevel: true/false, auto add level attribute to your object. False if not present.
'message': 'something to log' -> 'message': 'something to log' level: 'INFO'