Skip to content

Commit

Permalink
chore : logback update
Browse files Browse the repository at this point in the history
  • Loading branch information
gachon sw academy authored and gachon sw academy committed Aug 26, 2023
1 parent 22707d7 commit 0fa7a2d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ private String changeLifeCycle(Issue issue, Integer index, String destLifeCycle)

// 변경할 순서인덱스가 0이상이고 이슈 리스트보다 작을 경우
if (index >= 0 && index < issueList.size()) {

// 변경당할 인덱스를 가진 이슈 정보
IssueStatus targetIssue = issueList.stream().filter(sameIssue -> sameIssue.getIssueId().equals(issue.getIssueId())).findFirst().get();
// 해당 Index를 가진 기존 이슈 정보
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class AuthServiceImpl implements AuthService {
public UserInfoResponseDTO addSignUpUser(UserInfoReqestDTO userInfoReq) {
// Email 중복 체크
validateUniqueEmail(userInfoReq.getEmail());
log.info("회원가입 중복 체크");
// 사용자 정보 저장
User user = createUser(userInfoReq);
// 패스워드 암호화 후 저장
Expand All @@ -99,6 +100,7 @@ public UserInfoResponseDTO addSignUpUser(UserInfoReqestDTO userInfoReq) {
public TokenDto saveLoginUser(UserLoginReqestDTO userLoginReq) {
// 로그인한 유저 정보 저장
Authentication authentication = authenticateUser(userLoginReq.getEmail(), userLoginReq.getPassword());
log.info("유저 정보 저장");
// Token 생성
TokenDto tokenDto = jwtTokenProvider.generateToken(authentication);
// Refresh Token 관리
Expand Down
30 changes: 20 additions & 10 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<!-- 환경 변수 -->
<property name="CONSOLE_LOG_PATTERN"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %clr(%5level) %cyan(%logger) - %msg%n"/>
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %5level %logger - %msg%n"/>
<property name="SLACK_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %5level %logger %n %n %msg %n"/>
value="%d{yyyy-MM-dd HH:mm:ss.SSS, ${logback.timezone:-Asia/Seoul}} [%thread] %clr(%5level) %cyan(%logger) - %msg%n"/>
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS, ${logback.timezone:-Asia/Seoul}} [%thread] %5level %logger - %msg%n"/>
<property name="SLACK_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS, ${logback.timezone:-Asia/Seoul}} [%thread] %5level %logger %n %n %msg %n"/>
<springProperty name="SLACK_WEBHOOK_URL_DEV_WARN" source="logging.slack.webhook-url-dev-warn"/>
<springProperty name="SLACK_WEBHOOK_URL_DEV_ERROR" source="logging.slack.webhook-url-dev-error"/>
<springProperty name="SLACK_WEBHOOK_URL_PROD_ERROR" source="logging.slack.webhook-url-prod-error"/>
Expand All @@ -33,8 +33,11 @@
<pattern>
<pattern>
{
"timestamp": "%date{yyyyMMdd HHmmss.SSSSSS}",
"message": "%message"
"timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS, ${logback.timezone:-Asia/Seoul}}",
"log.level": "%-5level",
"message": "%message",
"process.thread.name": "%t",
"log.logger": "%C{2}"
}
</pattern>
</pattern>
Expand All @@ -46,7 +49,7 @@
</encoder>

<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>./logs/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<fileNamePattern>./logs/info-%d{yyyy-MM-dd, ${logback.timezone:-Asia/Seoul}}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
Expand All @@ -66,8 +69,11 @@
<pattern>
<pattern>
{
"timestamp": "%date{yyyyMMdd HHmmss.SSSSSS}",
"timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS, ${logback.timezone:-Asia/Seoul}}",
"log.level": "%-5level",
"message": "%yellow(%message)",
"process.thread.name": "%t",
"log.logger": "%C{2}",
"stacktrace": "%rEx"
}
</pattern>
Expand All @@ -80,7 +86,7 @@
</encoder>

<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>./logs/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<fileNamePattern>./logs/warn-%d{yyyy-MM-dd, ${logback.timezone:-Asia/Seoul}}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
Expand All @@ -100,8 +106,11 @@
<pattern>
<pattern>
{
"timestamp": "%date{yyyyMMdd HHmmss.SSSSSS}",
"timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS, ${logback.timezone:-Asia/Seoul}}",
"log.level": "%-5level",
"message": "%message",
"process.thread.name": "%t",
"log.logger": "%C{2}",
"stacktrace": "%rEx"
}
</pattern>
Expand All @@ -114,7 +123,7 @@
</encoder>

<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>./logs/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<fileNamePattern>./logs/error-%d{yyyy-MM-dd, ${logback.timezone:-Asia/Seoul}}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
Expand Down Expand Up @@ -184,6 +193,7 @@
<logger name="com.momentum.releaser" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="INFO"/>
</root>
</springProfile>

Expand Down

0 comments on commit 0fa7a2d

Please sign in to comment.