Skip to content

Commit 078d35e

Browse files
authored
fix(server): fix the logging setup (#1960)
1 parent bb79dde commit 078d35e

File tree

1 file changed

+12
-11
lines changed
  • jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver

1 file changed

+12
-11
lines changed

jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver/Main.kt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ import io.micrometer.prometheusmetrics.PrometheusMeterRegistry
2222
import java.time.Duration
2323
import kotlin.time.Duration.Companion.hours
2424

25-
private val prometheusRegistry =
26-
PrometheusMeterRegistry(
27-
object : PrometheusConfig {
28-
override fun get(key: String): String? = null
29-
30-
override fun prefix(): String = "github-actions-binding-server"
31-
32-
@Suppress("MagicNumber")
33-
override fun step() = Duration.ofSeconds(10)
34-
},
35-
)
3625
private val logger =
3726
System
3827
/*
@@ -45,6 +34,18 @@ private val logger =
4534
.setProperty("java.util.logging.manager", org.apache.logging.log4j.jul.LogManager::class.java.name)
4635
.let { logger { } }
4736

37+
private val prometheusRegistry =
38+
PrometheusMeterRegistry(
39+
object : PrometheusConfig {
40+
override fun get(key: String): String? = null
41+
42+
override fun prefix(): String = "github-actions-binding-server"
43+
44+
@Suppress("MagicNumber")
45+
override fun step() = Duration.ofSeconds(10)
46+
},
47+
)
48+
4849
fun main() {
4950
Thread.setDefaultUncaughtExceptionHandler { thread, throwable ->
5051
logger.error(throwable) { "Uncaught exception in thread $thread" }

0 commit comments

Comments
 (0)