import {createSyslogFormatter, levelToSyslog} from 'winston-syslog-formatter'
import {createLogger, format, transports} from 'winston'
const LOG_LEVEL = process.env.LOG_LEVEL || 'debug'
const APP_NAME = process.env.APP_NAME || 'app'
const HOST = process.env.HOST || 'death-star'
const logger = createLogger({
levels: levelToSyslog,
level: LOG_LEVEL,
format: format.combine(
format.colorize({message: true}),
createSyslogFormatter({
facility: 20,
appName: APP_NAME,
host: HOST,
verion: '1',
procId: process.pid,
}),
),
transports: [new transports.Console()],
})
export default logger
-
Notifications
You must be signed in to change notification settings - Fork 0
mixelburg/winston-syslog-formatter
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published