Commit 0077f80a authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Improve logging

parent 73596a1b
Pipeline #33868 passed with stages
in 3 minutes and 16 seconds
......@@ -21,12 +21,11 @@ import kotlin.system.exitProcess
class App {
companion object {
private val log = LogManager.getLogger("ReportProcessorApp")
private val log = LogManager.getLogger(this::class.java)
@JvmStatic fun main(args: Array<String>) {
try {
Service().run()
} catch (ex: Exception) {
ex.printStackTrace()
log.error("Stopping application due to error: " + ex.message)
exitProcess(1)
}
......
......@@ -30,7 +30,7 @@ class KafkaTopology(
private val settings: SettingsLoader
) {
private val klaxon = Klaxon()
private val log = LogManager.getLogger("ReportProcessorApp")
private val log = LogManager.getLogger(this::class.java)
fun prepare(): StreamsBuilder {
val builder = StreamsBuilder()
......
......@@ -21,7 +21,7 @@ import org.apache.logging.log4j.LogManager
import ch.memobase.settings.SettingsLoader
class Service(file: String = "app.yml") {
private val log = LogManager.getLogger("ReportProcessorService")
private val log = LogManager.getLogger(this::class.java)
val settings = SettingsLoader(
listOf(),
......@@ -33,7 +33,6 @@ class Service(file: String = "app.yml") {
stream.use {
it.start()
while (stream.state().isRunningOrRebalancing) {
log.info("Service is running.")
Thread.sleep(10_000L)
}
throw Exception("Stream stopped running!")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment