feat: vereinheitliche Startup-Logs in allen Backend-Services, verbessere Konsistenz und Diagnosemöglichkeiten
Signed-off-by: StefanMoCoAt <stefan.mo.co@gmail.com>
This commit is contained in:
+19
-1
@@ -2,12 +2,30 @@ package at.mocode.zns.import.service
|
||||
|
||||
import at.mocode.masterdata.domain.repository.*
|
||||
import at.mocode.zns.importer.ZnsImportService
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent
|
||||
import org.springframework.boot.runApplication
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.event.EventListener
|
||||
import org.springframework.core.env.Environment
|
||||
|
||||
@SpringBootApplication
|
||||
class ZnsImportServiceApplication {
|
||||
class ZnsImportServiceApplication(private val env: Environment) {
|
||||
|
||||
private val log = LoggerFactory.getLogger(ZnsImportServiceApplication::class.java)
|
||||
|
||||
@EventListener(ApplicationReadyEvent::class)
|
||||
fun onApplicationReady() {
|
||||
val springPort = env.getProperty("server.port", "8095")
|
||||
val appName = env.getProperty("spring.application.name", "zns-import-service")
|
||||
|
||||
log.info("----------------------------------------------------------")
|
||||
log.info("Application '{}' is running!", appName)
|
||||
log.info("Spring Management Port: {}", springPort)
|
||||
log.info("Profiles: {}", env.activeProfiles.joinToString(", "))
|
||||
log.info("----------------------------------------------------------")
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun znsImportService(
|
||||
|
||||
Reference in New Issue
Block a user