Add Logback configuration file

There are two main reasons for this change: by default, logback uses
stdout (!) and not stderr. This caused problems in programs like
packclass/unpackclass, where the packclass or JAR files were mixed in
with Netty's debug logging.

Secondly, the debug logging from lots of third-party libraries was
annoying (as it made it difficult to pick out OpenRS2-specific log
messages), so I've disabled lots of it.

Signed-off-by: Graham <gpe@openrs2.org>
Graham 3 years ago
parent 66c3027f8a
commit b3d6b112d2
  1. 1
      all/build.gradle.kts
  2. 1
      archive/build.gradle.kts
  3. 1
      buffer-generator/build.gradle.kts
  4. 1
      compress-cli/build.gradle.kts
  5. 2
      crc32/build.gradle.kts
  6. 1
      decompiler/build.gradle.kts
  7. 1
      deob-ast/build.gradle.kts
  8. 1
      deob-bytecode/build.gradle.kts
  9. 1
      deob/build.gradle.kts
  10. 1
      game/build.gradle.kts
  11. 20
      log/build.gradle.kts
  12. 25
      log/src/main/resources/logback.xml
  13. 1
      patcher/build.gradle.kts
  14. 1
      settings.gradle.kts

@ -21,6 +21,7 @@ dependencies {
implementation(projects.crc32) implementation(projects.crc32)
implementation(projects.deob) implementation(projects.deob)
implementation(projects.game) implementation(projects.game)
implementation(projects.log)
implementation(projects.patcher) implementation(projects.patcher)
} }

@ -18,6 +18,7 @@ dependencies {
implementation(projects.http) implementation(projects.http)
implementation(projects.inject) implementation(projects.inject)
implementation(projects.json) implementation(projects.json)
implementation(projects.log)
implementation(projects.net) implementation(projects.net)
implementation(projects.protocol) implementation(projects.protocol)
implementation(projects.util) implementation(projects.util)

@ -11,6 +11,7 @@ application {
dependencies { dependencies {
api(libs.clikt) api(libs.clikt)
implementation(projects.log)
implementation(projects.util) implementation(projects.util)
implementation(libs.kotlinPoet) implementation(libs.kotlinPoet)
implementation(libs.netty.buffer) implementation(libs.netty.buffer)

@ -13,6 +13,7 @@ dependencies {
implementation(projects.asm) implementation(projects.asm)
implementation(projects.compress) implementation(projects.compress)
implementation(projects.log)
implementation(projects.util) implementation(projects.util)
} }

@ -10,6 +10,8 @@ application {
dependencies { dependencies {
api(libs.clikt) api(libs.clikt)
implementation(projects.log)
} }
publishing { publishing {

@ -14,6 +14,7 @@ dependencies {
api(libs.clikt) api(libs.clikt)
api(libs.guice) api(libs.guice)
implementation(projects.log)
implementation(projects.util) implementation(projects.util)
implementation(libs.fernflower) implementation(libs.fernflower)
} }

@ -14,6 +14,7 @@ dependencies {
api(libs.guice) api(libs.guice)
implementation(projects.inject) implementation(projects.inject)
implementation(projects.log)
implementation(projects.util) implementation(projects.util)
implementation(libs.guava) implementation(libs.guava)
implementation(libs.javaParser) implementation(libs.javaParser)

@ -15,6 +15,7 @@ dependencies {
implementation(projects.deobAnnotations) implementation(projects.deobAnnotations)
implementation(projects.deobUtil) implementation(projects.deobUtil)
implementation(projects.inject) implementation(projects.inject)
implementation(projects.log)
implementation(projects.patcher) implementation(projects.patcher)
implementation(projects.yaml) implementation(projects.yaml)
implementation(libs.fastutil) implementation(libs.fastutil)

@ -16,6 +16,7 @@ dependencies {
implementation(projects.deobAst) implementation(projects.deobAst)
implementation(projects.deobBytecode) implementation(projects.deobBytecode)
implementation(projects.inject) implementation(projects.inject)
implementation(projects.log)
} }
publishing { publishing {

@ -15,6 +15,7 @@ dependencies {
implementation(projects.cache550) implementation(projects.cache550)
implementation(projects.conf) implementation(projects.conf)
implementation(projects.inject) implementation(projects.inject)
implementation(projects.log)
implementation(projects.net) implementation(projects.net)
implementation(projects.protocol) implementation(projects.protocol)
implementation(projects.util) implementation(projects.util)

@ -0,0 +1,20 @@
plugins {
`maven-publish`
kotlin("jvm")
}
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
pom {
packaging = "jar"
name.set("OpenRS2 Logging")
description.set(
"""
Provides OpenRS2's logback configuration file.
""".trimIndent()
)
}
}
}

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://ch.qos.logback/xml/ns/logback" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback https://raw.githubusercontent.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd">
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDERR" />
</root>
<logger name="com.zaxxer.hikari" level="WARN">
<appender-ref ref="STDERR" />
</logger>
<logger name="io.netty" level="INFO">
<appender-ref ref="STDERR" />
</logger>
<logger name="org.flywaydb" level="WARN">
<appender-ref ref="STDERR" />
</logger>
</configuration>

@ -15,6 +15,7 @@ dependencies {
implementation(projects.conf) implementation(projects.conf)
implementation(projects.inject) implementation(projects.inject)
implementation(projects.log)
implementation(libs.openrs2.natives) implementation(libs.openrs2.natives)
} }

@ -50,6 +50,7 @@ include(
"http", "http",
"inject", "inject",
"json", "json",
"log",
"net", "net",
"nonfree", "nonfree",
"nonfree:client", "nonfree:client",

Loading…
Cancel
Save