New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nestjs-fox-logger

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-fox-logger

Модуль логгера для Nestj.js

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source
Nest Logo

NestJS Logger Module with Cls suitable for Winston-Graylog transport

Installation

npm install --save nestjs-fox-logger nest-cls

Usage

Import

// In your root module
import { ClsModule } from 'nestjs-cls';

@Module({
  imports: [
    ClsModule.forRoot({
      middleware: {
        mount: true,
        generateId: true,
        idGenerator: (req: Request) => req.headers['X-Request-Id'] ?? nanoid(),
      },
      global: true,
    }),
  ],
})
export class AppModule {}
/// ...in a feature module (with cls)
import { FoxLoggerModule } from 'nestjs-fox-logger';

@Module({
  imports: [
    FoxLoggerModule.forFeature({
      name: 'SomeName',
    }),
  ],
  controllers: [],
  providers: [],
  exports: [],
})
export class SomeModule {}
// ...in a feature module (with cls)
import { FoxLoggerModule } from 'nestjs-fox-logger';

@Module({
  imports: [
    FoxLoggerModule.forFeatureAsync({
      useFactory: (cls: ClsService) => ({ name: 'SomeName', cls }),
      inject: [ClsService],
    }),
  ],
  controllers: [],
  providers: [],
  exports: [],
})
export class SomeModule {}

Call

Regular

import { LoopService } from 'nestjs-fox-logger';

@Injectable()
export class YourService {
  constructor(private readonly logger: FoxLoggerService) {}

  async foo() {
    await this.logger.log('someMessage');
    await this.logger.log('someMessage');
  }
}
With Event ID
import { LoopService } from 'nestjs-fox-logger';

@Injectable()
export class YourService {
  constructor(private readonly logger: FoxLoggerService) {}

  async foo() {
    const eventId = nanoid();
    await this.logger.log('someMessage', eventId);
  }
}

Author

Semen Kononets (GitHub)

LICENSE

MIT

Keywords

nestjs

FAQs

Package last updated on 12 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts