loggerific
v1.2.0
Published
A simple app logger for microservices
Downloads
10
Readme
loggerific
A simple app logger for microservices
Writes loglines to stdout by default (this is customizable). Each logline is a
JSON string containing time
, host
, app
, event
& data
fields. time
is standardized to ISO 8601 UTC.
Usage
var loggerific = require('loggerific')
var log = loggerific('some-app-name')
log('boot', {url: 'http://blah'})
// output: {"time":"2015-08-08T04:37:11.267Z","host":"my-host-name","app":"some-app-name","event":"boot","data":{"url":"http://blah"}}
Questions
I don't want to log to stdout. Can I log somewhere else?
Yes, you can provide a stream to write to as follows:
var log = loggerific(app, {
writable: writableStream
})
Can I override the default hostname?
Yes, you can do so as follows:
var log = loggerific(app, {
host: 'my-hostname.domain'
})