@motech-development/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

npm size sonar

@motech-development/logger

NestJS application logger

A Morgan logger for NestJS.

Installation

Add @motech-development/logger as a dependency.

# Yarn
yarn add @motech-development/logger

# NPM
npm i @motech-development/logger

Usage

Add the LoggerModule to your application.

import { LoggerModule } from '@motech-development/logger';

@Module({
  imports: [LoggerModule],
})
class AppModule {}

This will automatically begin to log all network requests in your application and provide the logger to use in your application.

import { Logger } from '@motech-development/logger';

@Injectable()
class MyService {
  private readonly logger = new Logger();

  public myMethod(): void {
    this.logger.log('Testing, 123');
  }
}

// Or...

@Injectable()
class AnotherService {
  constructor(private readonly logger: Logger) {}

  public myMethod(): void {
    this.logger.debug('Testing, 123');
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @motech-development/logger

Weekly Downloads

13

Version

1.0.7

License

MIT

Unpacked Size

28.6 kB

Total Files

10

Last publish

Collaborators

  • mogusbi