1.0.12 • Published 1 year ago

mongodb-queue-log-nestjs v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

mongodb-queue-log-nestjs

Description

This package is fork of mongodb-log-nestjs with additional methods to register raw data from the Redis queue

Instalation

npm i --save mongodb-queue-log-nestjs

Quick Start

Important By default, the Redis configuration is set to localhost:6379, use MongodbLogService constructor to modify if necessary

Example

import { Injectable } from '@nestjs/common';
import { MongodbLogService } from 'mongodb-queue-log-nestjs';

@Injectable()
export class Logger {

    constructor(private mongoService: MongodbLogService) {}

    private registerLog(collection, log) {
        return this.mongoService.registerOn(collection, log, true);
    }

    async log(data: any, collection = 'other_collection'): Promise<any> {
        return await this.registerLog(collection, data)
    }

}