Skip to content

Commit

Permalink
fix: winston config service imports, package json dev command, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
abriginets committed Feb 12, 2024
1 parent 23ec310 commit d3fb465
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
Expand Down
4 changes: 4 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Module } from '@nestjs/common';
import { ConfigModule as NativeConfigModule } from '@nestjs/config';
import { APP_INTERCEPTOR } from '@nestjs/core';

import { ConfigModule } from './config/config.module';
import { ConfigService } from './config/config.service';
import { WinstonConfigService } from './winston-config/winston-config.service';

@Module({
Expand All @@ -14,7 +16,9 @@ import { WinstonConfigService } from './winston-config/winston-config.service';
cache: true,
}),
WinstonModule.forRootAsync({
imports: [ConfigModule],
useClass: WinstonConfigService,
inject: [ConfigService],
}),
CacheModule.register(),
],
Expand Down
4 changes: 2 additions & 2 deletions src/winston-config/winston-config.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { utilities as nestWinstonModuleUtilities } from 'nest-winston';
import { WinstonModuleOptionsFactory, utilities as nestWinstonModuleUtilities } from 'nest-winston';
import winston, { LoggerOptions } from 'winston';

import { Injectable } from '@nestjs/common';

import { ConfigService } from '../config/config.service';

@Injectable()
export class WinstonConfigService {
export class WinstonConfigService implements WinstonModuleOptionsFactory {
constructor(private readonly configService: ConfigService) {}

#getDevelopmentTransport(): winston.transport[] {
Expand Down

0 comments on commit d3fb465

Please sign in to comment.