ts-mongodb-logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

MongoDB log channel for composite logger

Use this package in your applications for logging to MongoDB. You can learn more about composite logger here.

npm install -S ts-mongodb-logger

Usage

import {Logger} from "ts-composite-logger";
import {MongoDB} from "ts-mongodb-logger";
  
const mongo = new MongoDB(
    "mongodb://serkyron:password@localhost:27017/?authMechanism=SCRAM-SHA-1&authSource=dbname",
    "dbname",
    "log",
);

mongo.connect()
  .catch((e) => {console.error(e.message)});

global.logger = (new Logger())
  .addChannel(mongo);
	
global.logger.info("VM connected");

Package Sidebar

Install

npm i ts-mongodb-logger

Weekly Downloads

6

Version

1.0.5

License

ISC

Unpacked Size

8.01 kB

Total Files

8

Last publish

Collaborators

  • serkyron