@storyous/logger
v1.2.0
Published
## Usage
Downloads
137
Keywords
Readme
logger
Usage
import { initLogger } from '@storyous/logger';
const config = {
env: process.env.NODE_ENV,
logging: {
console: {
colorize: true,
// Use for localhost development only, it will output nicely readable logs
// and if error appears the stack will be clickable in webstorm
prettyOutput: true,
},
loggly: {
silent: true,
token: process.env.LOGGLY_TOKEN || '',
subdomain: 'storyous',
tags: ['serviceName', process.env.NODE_ENV],
json: true
},
sentry: {
dsn: process.env.SENTRY_DSN || '',
level: 'error',
silent: true
}
}
}
const logger = initLogger(config.env, config.logging);
// define new logger for specific module
const logModule = logger.module('extraLogger');
export default logger;