Skip to content

Commit

Permalink
feat: TimeLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
toychip committed Aug 31, 2024
1 parent b02263b commit 30276c4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions api/src/main/kotlin/com/mashup/dojo/common/TimeLogger.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.mashup.dojo.common

import jakarta.annotation.PostConstruct
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter

@Component
class TimeLogger {

private val logger: Logger = LoggerFactory.getLogger(TimeLogger::class.java)

@PostConstruct
fun logCurrentTime() {
val now = ZonedDateTime.now()
val formattedTime = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss Z"))
logger.info("Application started at: $formattedTime")
}
}

0 comments on commit 30276c4

Please sign in to comment.