@ronald-fuchs/mbl-logger
v1.1.3
Published
Mongoose based (DB-) logger.
Downloads
1
Readme
MBL Logger
DB-Logger using MongoDB via Mongoose.
Usage
Use with Singleton instance
const logger = require('@ronald-fuchs/mbl-logger').Singleton.register("myScope");
async function doWithSingleton() {
await logger.loadOrSetConfig({ logLevel: 'error' , logToConsole: true, logToFile: false }, false);
const id = await logger.logError(1001, { msg: 'Test-Error' }, { user: 'John' });
console.log(id);
}
doWithSingleton();
Use with new instance
const logging = require('@ronald-fuchs/mbl-logger');
const logger = new logging.MblLogger();
async function doWithInstance() {
const id = await logger.logWarning(1002, { msg: 'Test-Warning' }, { user: 'John' });
console.log(id);
}
doWithInstance();
License
MIT license: https://mit-license.org/