1.0.7 • Published 2 years ago

anoda-logger v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

About The Project

Simple logger module for NestJS that allows you to stream logs from many environments and projects to one server.

Built With

Prerequisites

  • Node ^16
  • NestJS ^8

Local installation

npm install anoda-logger

Import files to your main.ts file.

import { AnodaMiddleware, AnodaConfig, AnodaLogger } from 'anoda-logger';

Set up your main.ts.

AnodaConfig.init({
        env:       //Your enviroment,
        appName:   //Your app name,
        loggerUri: // Uri for your logger server,
        loggerKey: // Logger access key,
    });

    app.useLogger(new AnodaLogger());
    app.use(AnodaMiddleware);
    

Import LoggerMiddleware to app.module.ts.

import { LoggerMiddleware } from 'anoda-logger';

Set up LoggerMiddleware.

export class AppModule implements NestModule {
    public configure (consumer: MiddlewareConsumer): void {
        consumer
            .apply(LoggerMiddleware)
            .forRoutes('*');
    }
}

Copyright 2022 ANODA, all rights reserved

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago