-
Notifications
You must be signed in to change notification settings - Fork 1
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/#75 Logbat Java SDK 프로젝트 세팅 및 테스트 #78
Conversation
Risk Level 2 - /home/runner/work/Team5-Guys/Team5-Guys/sdk/java/logbat-sdk/src/main/java/info/logbat/logback/LogbatAppender.java
🔍📜⚙️ Powered by Code Review GPT |
타 프로젝트의 application.yml이 포함되어 제거했습니다.
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.
이게 왜 낀거지!!!!!
sdk/java/logbat-sdk/build.gradle
Outdated
implementation 'ch.qos.logback:logback-classic:1.3.8' | ||
implementation 'org.slf4j:slf4j-api:2.0.7' |
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.
logback에 slf4j의존이 포함되있을걸요?!
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.
앗 뺀다는 걸 깜빡했네요!! 감사합니당
@Override | ||
protected void append(ILoggingEvent eventObject) { | ||
String logMessage = eventObject.getFormattedMessage(); | ||
System.out.println("Logbat Appender: " + logMessage); | ||
} |
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.
어떤 부분을 오버라이딩한건지 작성해주시면 감사하겠습니당 :D
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.
PR에 설명 추가했습니다!
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.
👍 프로젝트 세팅부 잘 확인했습니다!
* init: logbat-sdk 프로젝트 세팅 * chore: main 클래스 제거 * feat: logback 및 SLF4J 의존성 추가 및 JAR 매니페스트 설정 추가 * feat: System out LogbatAppender 추가 * chore: gitignore에 DS_Store 추가 * �chore: application.yml 제거 타 프로젝트의 application.yml이 포함되어 제거했습니다. * chore: build.gradle에서 slf4j-api 의존성 제거
🚀 작업 내용
테스트
Appender는 다음과 같이 등록했습니다.
logback.xml
Appender 부연 설명
위처럼 로그를 호출 했을 때
log.info()
메서드를 호출하게 되고Logger의 classic 구현체에서
가 호출됩니다.
이후 메서드에서
라는 로깅 이벤트 생성 메서드가 호출되게되고
위 코드에서 callAppender를 호출하게 됩니다.
위 메서드들에서 등록된 현재
Logger
부터 부모Logger
들을 (부모 Logger에 관한 부분은 이후에 내용 추가하겠습니다.) 순회하며 모두appendLoopOnAppenders
를 호출하게 되는데위의
최종적으로 `LogbatAppender`의 `append`메서드가 호출되게 됩니다.doAppend
메서드가 호출되면 구현해둔AppenderBase
구현체인LogbatAppender
의doAppend
메서드(부모 메서드)가 호출되고추가: LogbatAppender는 logback.xml에서 설명해두면
ContextInitializer
에 의해 초기화되어LoggerContext
에 생성되고, 이후 LoggerFacotry에서 getLogeer로 가져올 때는 초기화된LogbatAppender
의 인스턴스가 포함됩니다.📸 이슈 번호
👀 Focus Commits [Optional]
✍ 궁금한 점