Closed zalavaari closed 2 years ago
Hi @zalavaari,
Thanks for reporting this!
The current releases of the loki-logback-appender contains all of the dependencies, therefore it cannot be used in a modular Java 11+ project because of package collisions.
Could you please specify what particular packages do you mean here?
Hi!
com.google.protobuf
for example.
But sorry, there was a misunderstanding on our side: Modular usage is not a problem, since we don't need a direct dependency for the module loki.logback.appender
in a regular use case. (I'm not quite understand the reason of this, but I guess there might be some black magic under the hood around logback, and - in our case - slf4j)
However the problem might still be valid for non-modular (classpath-based) apps too, even if there won't be an error message or a warning in that case. For example in projects, where protobuf is already used, there could be two different protobuf versions on the classpath easily. In that case you won't have control on which version of the protobuf classes will be loaded, since it will depends on the loading order of the jars, instead of the maven/gradle version definition. Therefore the class versions might be different when you run your project directly, or when running it from an IDE.
Yeah, this makes sense. I'll put everything into com.github.loki4j
package to avoid possible collisions.
The fix was published in v1.3.0-rc1 (release page). Feel free to re-open this ticket or create a new one in case of any issues.
The current releases of the
loki-logback-appender
contains all of the dependencies, therefore it cannot be used in a modular Java 11+ project because of package collisions.Is it possible to provide another
loki-logback-appender
artifact, which contains only the project's own files?The
loki-logback-appender
can be JPMS-compatible even without a propermodule-info.java
, if these dependencies won't be in the jar.