Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

jcare44/winston-logmatic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winston-logmatic

Winston transport for Logmatic

npm i -S winston-logmatic

Config

You need to pass down a node-logmatic config objects to winston-logmatic for him to work.

{
  logmatic: {
    token: undefined, // Required : your Logmatic token
    defaultProps: {} // add a default value to your log messages (like appname or hostname)
  }
}

Examples

new Winston.Logger({
  transports: [
    new Winston.transports.Console({
      colorize: true,
      timestamp: true
    }),
    new WinstonLogmatic({
      logmatic: {
        token: 'MY_TOKEN',
        defaultProps: {
          appname: require('./package.json').name,
          hostname: 'prod'
        }
      }
    })
  ],
  timestamp: true,
  level: 'debug'
});

About

Winston transport for Logmatic

Resources

License

Stars

Watchers

Forks

Packages

No packages published