import logger from './logger';
const options: LoggerOptions = {
level: 'silly',
silent: process.env.NODE_ENV !== 'development',
debugLog: {
level: 'debug',
filename: 'logs/debug-log-%DATE%.json',
datePattern: 'YYYY-MM-DD',
maxSize: '1g',
},
errorLog: {
level: 'error',
filename: 'logs/error-log-%DATE%.json',
datePattern: 'YYYY-MM-DD',
maxSize: '1g',
},
};
logger.config(options);
logger.error('Error message');
logger.warn('Warn message');
logger.info('Info message');
logger.http('HTTP message');
logger.db('DB message');
logger.verbose('Verbose message');
logger.debug('Debug message');
logger.silly('Silly message');
-
Notifications
You must be signed in to change notification settings - Fork 0
tobiaswaelde/tw-logger
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Custom winston logger for express
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published