
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
log4js-fluent-appender
Advanced tools
This package provides log4js-node appender for fluent-logger.
$ npm install log4js-fluent-appender
Fluent daemon should listen on TCP port.
Simple configuration is following:
<source>
@type forward
port 24224
</source>
<match **.*>
@type stdout
</match>
const log4js = require('log4js');
log4js.configure({
appenders: {
fluent: {
type: 'log4js-fluent-appender',
tag_prefix: 'tag_prefix',
options: {
levelTag: true,
host: 'localhost',
port: 24224
}
}
},
categories: {
default: {
appenders: ['fluent'],
level: 'info'
}
}
});
const logger = log4js.getLogger();
logger.info('This is info message!');
setTimeout(() => {
log4js.shutdown(() => {});
}, 1000);
See also:
const log4js = require('log4js');
const fluentAppender = log4js.configure({
appenders: {
fluent: {
type: 'log4js-fluent-appender',
tag_prefix: 'tag_prefix',
options: {
levelTag: true,
host: 'localhost',
port: 24224
}
}
},
categories: {
default: {
appenders: ['fluent'],
level: 'info'
}
}
});
fluentAppender.on('connect', () => {
console.log('connect event!');
});
fluentAppender.on('error', (error) => {
console.log('error occured!');
});
connect
: Handle net.Socket Event: connecterror
: Handle net.Socket Event: errorlevelTag
If false
, tag is "mytag". Otherwise tag is "mytag.INFO".
If you want to omit level tag such as .INFO
, you must specify this value to false
.
See fluent-logger.
Apache License, Version 2.0.
FAQs
Custom appender for log4js based on fluent-logger
The npm package log4js-fluent-appender receives a total of 142 weekly downloads. As such, log4js-fluent-appender popularity was classified as not popular.
We found that log4js-fluent-appender demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.