loggerific

1.2.0 • Public • Published

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'
})

Readme

Keywords

Package Sidebar

Install

npm i loggerific

Weekly Downloads

2

Version

1.2.0

License

MIT

Last publish

Collaborators

  • khoomeister