Skip to content

Commit

Permalink
log: winston logger 설치
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungGwan123 committed Nov 26, 2024
1 parent 172091c commit 3cad000
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ioredis": "^5.4.1",
"js-yaml": "^4.1.0",
"mysql2": "^3.11.3",
"nest-winston": "1.9.7",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"passport-kakao": "^1.0.1",
Expand All @@ -50,6 +51,8 @@
"tunnel-ssh": "^5.1.2",
"typeorm": "^0.3.20",
"uuid": "^11.0.3",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0",
"ws": "^8.18.0"
},
"devDependencies": {
Expand All @@ -67,6 +70,7 @@
"@types/passport-kakao": "^1",
"@types/socket.io": "^3.0.2",
"@types/supertest": "^6.0.0",
"@types/winston": "^2.4.4",
"@types/ws": "^8.5.13",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import { RedisModule } from './redis/redis.module';
import { ScheduleModule as NestScheduleModule } from '@nestjs/schedule';
import { ScheduleModule } from './schedule/schedule.module';
import { TradehistoryModule } from './trade-history/trade-history.module';
import { WinstonModule } from 'nest-winston';
import { winstonConfig } from 'config/winston.config';

@Module({
imports: [
AuthModule,
AuthModule,
HealthModule,
AccountModule,
TradeModule,
Expand All @@ -29,6 +31,7 @@ import { TradehistoryModule } from './trade-history/trade-history.module';
NestScheduleModule.forRoot(),
ScheduleModule,
TradehistoryModule,
WinstonModule.forRoot(winstonConfig),
],
controllers: [AppController],
providers: [AppService],
Expand Down
6 changes: 5 additions & 1 deletion packages/server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ import {
import { config } from 'dotenv';
import { setupSshTunnel } from './configs/ssh-tunnel';
import { AllExceptionsFilter } from 'common/all-exceptions.filter';
import { WinstonModule } from 'nest-winston';
import { winstonConfig } from 'config/winston.config';

config();

async function bootstrap() {
await setupSshTunnel();
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(AppModule,{
logger: WinstonModule.createLogger(winstonConfig)
});
app.enableCors({
origin: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
Expand Down

0 comments on commit 3cad000

Please sign in to comment.