npm

Need private packages and team management tools?Check out npm Orgs. »

slf4ts-cassandra-log-adapter

1.1.5 • Public • Published

slf4ts-cassandra-log-adapter

Cassandra Logging-Adapter for slf4ts

NPM Version License Dependencies Status

This project forwards log events from datastax cassandra driver to slf4ts logger implementation.
It's s meant to be used with nodejs.

Usage

import { ILoggerInstance, LoggerFactory } from "slf4ts-api";
 
// create an instance of Client
const client = new Client({ contactPoints: ["127.0.0.1:9042"] });
 
// Create an instance of the logging adapter for each client
// creates/uses a logger with group "cassandra" and the keyspace of the client as name (empty string if not configured) 
new CassandraLogAdapter(client);
 
// Create an instance of the logging adapter with a pre-created logger instance
const logger: ILoggerInstance = LoggerFactory.getLogger("my-cassandra");
new CassandraLogAdapter(client, logger);
 
// use the client as usual
client.connect(() => {
    ...
});
 
// access the underlying logger instance
const logger: ILoggerInstance = LoggerFactory.getLogger("cassandra", client.keyspace);
logger.setLogLevel(...);

License

MIT

install

npm i slf4ts-cassandra-log-adapter

Downloadsweekly downloads

29

version

1.1.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability