https://kotlinlang.org logo
c

christophsturm

01/19/2021, 1:25 PM
what do you guys think of creating a kotlin-logging package that depends on log4j2 and has a useful default config?
o

oshai

01/24/2021, 10:04 PM
not sure what you mean. can you explain?
c

christophsturm

01/24/2021, 10:07 PM
in my build file i have this lines corresponding to logging:
Copy code
implementation("io.github.microutils:kotlin-logging:2.0.4")
    implementation("org.apache.logging.log4j:log4j-core:$log4j2Version")
    implementation("org.apache.logging.log4j:log4j-api:$log4j2Version")
    implementation("org.apache.logging.log4j:log4j-jul:$log4j2Version")
    implementation("org.apache.logging.log4j:log4j-slf4j18-impl:$log4j2Version")
its pretty hard to get right.
i think it would be great to have an opinionated gradle dependency that is sufficient to get decent logging without many pitfalls
o

oshai

01/25/2021, 4:22 AM
ok, but you still need the xml. Maybe an example (in a blogpost or wiki) is enough?
c

christophsturm

02/20/2021, 1:01 PM
You could do without the xml and configure via Kotlin code. And even offer an Kotlin api that makes configuration easy. But I never got configuration via Kotlin code working.
37 Views