@kursattkorkmazzz/appender4kafka
v1.0.1
Published
This is custom appender for log4js. This helps to users to send logs to their kafka server.
Downloads
13
Readme
The example below is the example usage of appender.
log4js.configure({
appenders: {
console: { type: "stdout" },
kafka: {
type: "@kursattkorkmazzz/kafka_appender_4_log4js",
host: "host",
port: "0000",
topic: "service1.log",
},
},
categories: {
default: { appenders: ["console", "kafka"], level: "all" },
},
});
const logger = log4js.getLogger();
logger.error("This is test log.", "Hello buddy");
Options are:
- host: The host ip address of kafka
- port: The port of kafka running on.
- topic: The topic name for the log will be publish.