Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
add logger
Browse files Browse the repository at this point in the history
  • Loading branch information
LimiteDiTempo committed Aug 26, 2024
1 parent 529cb98 commit ed2af5d
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.byebye.chapterTwo.global.common

import jakarta.annotation.PostConstruct
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Component

@Component
class EnvironmentLogger {
@Value("\${spring.datasource.url}")
private val dbUrl: String? = null

@Value("\${spring.datasource.username}")
private val dbUsername: String? = null

@Value("\${spring.datasource.password}")
private val dbPassword: String? = null

@PostConstruct
fun logEnvironment() {
println("Database URL: $dbUrl")
println("Database Username: $dbUsername")
// Note: Be careful with logging sensitive information like passwords
println("Database Password: $dbPassword")
}
}

0 comments on commit ed2af5d

Please sign in to comment.