-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] logger 적용 #333
[Feat] logger 적용 #333
Conversation
|
||
console.log('today : ', today); | ||
const logFileName = `application-${today.toISOString().split('T')[0]}.log`; | ||
const localFilePath = path.join(logsDir, logFileName); | ||
|
||
console.log('localFilePath : ', localFilePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3 : 필요없는 log나 주석은 삭제해주셔도 좋을 것 같아요~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p1:
서버측에 로그 생성시 생성되었다는 것을 알리기 위해 console.log를 사용하신 걸까요??
현재 lint 상에 console.log는 오류가 발생하도록 되어있어 CI/CD시 오류가 발생할 것으로 보입니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉 테스트하고 그대로 뒀습니다 삭제하겠습니다~!
|
||
try { | ||
const uploadResponse = await this.s3.send(new PutObjectCommand(params)); | ||
// console.log('File uploaded:', uploadResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이따가 로거 어떻게적용되는지, 어디에 추가로 적용하면좋을지 얘기해보면좋을거같ㅇ습니다!
apps/api/src/app.module.ts
Outdated
import { ConfigModule } from '@nestjs/config'; | ||
import { ScheduleModule } from '@nestjs/schedule'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3
사용하지않는 IMPORT 제거부탁드립니다!
|
||
console.log('today : ', today); | ||
const logFileName = `application-${today.toISOString().split('T')[0]}.log`; | ||
const localFilePath = path.join(logsDir, logFileName); | ||
|
||
console.log('localFilePath : ', localFilePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p1:
서버측에 로그 생성시 생성되었다는 것을 알리기 위해 console.log를 사용하신 걸까요??
현재 lint 상에 console.log는 오류가 발생하도록 되어있어 CI/CD시 오류가 발생할 것으로 보입니다
관련 이슈 번호
작업 내용
PR 포인트
고민과 학습내용
winston logger를 추가하였습니다. 모든 api 요청에 대해 log를 남기도록 했습니다.
logger를 모듈로 분리하여 각각의 모듈에서 import 하여 사용할 수 있습니다.
winston을 매일 1개의 .log 파일을 생성하도록 설정하였습니다.
따라서 이 Log파일을 batch를 이용하여 매일 1번씩 Object Storage로 업로드 하도록 구현하였습니다.
스크린샷