-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
879 additions
and
763 deletions.
There are no files selected for viewing
Submodule dutypark_secret
updated
from fd2802 to 30909b
This file contains 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
57 changes: 57 additions & 0 deletions
57
src/main/kotlin/com/tistory/shanepark/dutypark/common/config/LogbackConfig.kt
This file contains 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,57 @@ | ||
package com.tistory.shanepark.dutypark.common.config | ||
|
||
import ch.qos.logback.classic.Level | ||
import ch.qos.logback.classic.LoggerContext | ||
import ch.qos.logback.classic.encoder.PatternLayoutEncoder | ||
import ch.qos.logback.classic.spi.ILoggingEvent | ||
import ch.qos.logback.core.rolling.RollingFileAppender | ||
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy | ||
import jakarta.annotation.PostConstruct | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.context.annotation.Configuration | ||
|
||
@Configuration | ||
class LogbackConfig { | ||
|
||
@Value("\${dutypark.log.path}") | ||
private lateinit var logPath: String | ||
|
||
val log: Logger = LoggerFactory.getLogger(LogbackConfig::class.java) | ||
|
||
@PostConstruct | ||
fun configureLogging() { | ||
val loggerContext = LoggerFactory.getILoggerFactory() as LoggerContext | ||
|
||
val encoder = PatternLayoutEncoder().apply { | ||
context = loggerContext | ||
pattern = "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n" | ||
start() | ||
} | ||
|
||
val fileAppender = RollingFileAppender<ILoggingEvent>().apply { | ||
context = loggerContext | ||
name = "FILE" | ||
this.encoder = encoder | ||
isAppend = true | ||
} | ||
|
||
val rollingPolicy = TimeBasedRollingPolicy<ILoggingEvent>().apply { | ||
context = loggerContext | ||
fileNamePattern = "${logPath}/dutypark-%d{yyyy-MM-dd}.log" | ||
maxHistory = 365 | ||
setParent(fileAppender) | ||
start() | ||
} | ||
|
||
fileAppender.rollingPolicy = rollingPolicy | ||
fileAppender.start() | ||
|
||
val rootLogger = loggerContext.getLogger("ROOT") | ||
rootLogger.level = Level.INFO | ||
rootLogger.addAppender(fileAppender) | ||
|
||
log.info("log file path: $logPath") | ||
} | ||
} |
This file contains 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
This file contains 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
3 changes: 2 additions & 1 deletion
3
src/main/kotlin/com/tistory/shanepark/dutypark/common/slack/notifier/SlackNotifierLogger.kt
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.