-
Notifications
You must be signed in to change notification settings - Fork 2
[FEAT] 로그백 설정 #173
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
Open
kjy-asl
wants to merge
4
commits into
develop
Choose a base branch
from
feat/#165-logback
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[FEAT] 로그백 설정 #173
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,4 +38,8 @@ out/ | |
|
|
||
|
|
||
| ### config yml ### | ||
| application-**.yml | ||
| application-**.yml | ||
|
|
||
|
|
||
| ### log ### | ||
| *.log | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| <configuration scan="true" scanPeriod="60 seconds"> | ||
| <property name="LOG_PATH" value="log"/> | ||
| <property name="LOG_FILE_NAME" value="errorLog"/> | ||
| <property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [traceId=%X{traceId}] [%thread] [%logger{40}] - %msg%n"/> | ||
|
|
||
| <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
| <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
| <Pattern>${LOG_PATTERN}</Pattern> | ||
| </encoder> | ||
| </appender> | ||
|
|
||
| <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
|
|
||
| <filter class="ch.qos.logback.classic.filter.LevelFilter"> <!--appender가 동작할 조건 설정--> | ||
| <level>ERROR</level> <!--error level에서만 동작--> | ||
| <onMatch>ACCEPT</onMatch> | ||
| <onMismatch>DENY</onMismatch> | ||
| </filter> | ||
|
|
||
| <file>${LOG_PATH}/${LOG_FILE_NAME}.log</file> | ||
|
|
||
| <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
| <pattern>${LOG_PATTERN}</pattern> | ||
| </encoder> | ||
|
|
||
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| <fileNamePattern>${LOG_PATH}/%d{yyyy-MM, aux}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.log</fileNamePattern> | ||
| <totalSizeCap>20GB</totalSizeCap> | ||
| </rollingPolicy> | ||
|
|
||
| </appender> | ||
|
|
||
| <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
|
|
||
| <filter class="ch.qos.logback.classic.filter.LevelFilter"> <!--appender가 동작할 조건 설정--> | ||
| <level>WARN</level> <!--warn level에서만 동작--> | ||
| <onMatch>ACCEPT</onMatch> | ||
| <onMismatch>DENY</onMismatch> | ||
| </filter> | ||
|
|
||
| <file>log/warnLog.log</file> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기는 ${LOG_PATH}를 안쓰나요?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이건 고쳐서 다시 푸시하겠습니당 감사해요! |
||
|
|
||
| <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
| <pattern>${LOG_PATTERN}</pattern> | ||
| </encoder> | ||
|
|
||
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| <fileNamePattern>${LOG_PATH}/%d{yyyy-MM, aux}/warnLog.%d{yyyy-MM-dd}.log</fileNamePattern> | ||
| <totalSizeCap>20GB</totalSizeCap> | ||
| </rollingPolicy> | ||
|
|
||
| </appender> | ||
|
|
||
| <root level="INFO"> | ||
| <appender-ref ref="CONSOLE"/> | ||
| <appender-ref ref="ERROR_FILE"/> | ||
| <appender-ref ref="WARN_FILE"/> | ||
| </root> | ||
| </configuration> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
저희 인스턴스 생각하면 20기가면 큰 것 같습니다. 더 작게 제한하면 좋을 것 같아요. 2GB라던지!?
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.
로그파일은 ec2말고 s3에 저장하는 경우도 있던데, 어떻게 생각하세욤?
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.
2GB로 줄이는게 나을 듯 하네용.
그리고 s3에 저장하는 경우는 한 번 찾아보고 적용하겠습니당.
땡큐!