@egomobile/mongo-log
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

npm last build PRs Welcome

@egomobile/mongo-log

A middleware for js-log, which writes logs to a Mongo database, using node-mongo.

Install

Execute the following command from your project folder, where your package.json file is stored:

npm install --save @egomobile/mongo-log

The following modules are defined in peerDependencies and have to be installed manually:

Usage

import log, {
  consoleLogger as useConsoleLogger,
  useFallback,
  useMongoLogger,
} from "@egomobile/mongo-log";

// reset the logger to configure it from scratch
log.reset();

// use mongo logger as first middleware and console logger as a fallback
log.use(useFallback(useMongoLogger(), useConsoleLogger()));

log("foo"); // default: debug
log.debug("foo"); // debug
log.error("foo"); // error
log.warn("foo"); // warning
log.info("foo"); // information
log.trace("foo"); // trace

Documentation

The API documentation can be found here.

Package Sidebar

Install

npm i @egomobile/mongo-log

Weekly Downloads

0

Version

1.0.0

License

LGPL-3.0

Unpacked Size

21.5 kB

Total Files

8

Last publish

Collaborators

  • ekmobile
  • egodux
  • mkloubertego
  • mkloubert
  • ekegodigital