@loglayer/transport-log4js
v1.0.8
Published
log4js transport for loglayer.
Downloads
621
Maintainers
Readme
Log4js Transport for LogLayer
The Log4js transport for LogLayer.
Log4js-node is a conversion of the Log4j framework to Node.js.
Important Notes
- Log4js only works in Node.js environments (not in browsers)
- By default, logging is disabled and must be configured via
level
or advanced configuration - Consider using Winston as an alternative if Log4js configuration is too complex
Installation
npm install loglayer @loglayer/transport-log4js log4js
Usage
import log4js from 'log4js'
import { LogLayer } from 'loglayer'
import { Log4JsTransport } from "@loglayer/transport-log4js"
const logger = log4js.getLogger()
// Enable logging output
logger.level = "trace"
const log = new LogLayer({
transport: new Log4JsTransport({
logger
})
})
Documentation
For more details, visit https://loglayer.dev/transports/log4js