loki4j / loki-logback-appender

Fast and lightweight implementation of Logback appender for Grafana Loki
https://loki4j.github.io/loki-logback-appender/
BSD 2-Clause "Simplified" License
314 stars 27 forks source link

Allow extending Loki4jAppender #179

Closed mtatheonly closed 1 year ago

mtatheonly commented 1 year ago

Hello, I'm trying to use the loki-logback-appender in a Quarkus Application but I'm getting an error related to the class Loki4JAppender being final.

The error is "java.lang.IncompatibleClassChangeError: class com.github.loki4j.logback.Loki4jAppender$$delayed cannot inherit from final class com.github.loki4j.logback.Loki4jAppender"

There's a quarkus extension - io.quarkiverse.logging.logback:quarkus-logging-logback that allows using logback appenders in a quarkus application. It seems that the extension is trying to extend the appender class in order to use it.

In my local development setup, I've created a copy of Loki4jAppender, removing the final class modifier and it worked.

Could be possible to remove that final modifier?

nehaev commented 1 year ago

Hi @mtatheonly, thanks for reporting this! I see no issue in removing the final modifier from Loki4jAppender. Would you like to create a PR for this?