Experimental Quarkiverse Logback Support

582 views
Skip to first unread message

Stuart Douglas

unread,
Jul 22, 2021, 11:06:40 PM7/22/21
to Quarkus Development mailing list
Hi Everyone,

I have just done a 0.1.0 release of quarkus-logging-logback: https://github.com/quarkiverse/quarkus-logging-logback

This is a bridge between jboss-logging and logback, that allows you to use logback.xml to configure logging, and more importantly use logback appenders in your Quarkus application. This makes it possible to integrate Quarkus applications with 3rd party monitoring solutions that provide logback appenders.

Note that this does not replace jboss-logmanager and the core Quarkus logging system, instead logging events are passed from jboss-logging into the logmanager appender layer (so jboss-logging basically treats logback as an additional appender). Other non-appender configuration such as log levels is supported by translating the configuration into the equivalent quarkus config properties. Because this is not using logback as the actual logging engine we cannot guarantee 'bug for bug' compatibility, however for the main use case (integrating with other products) this should not be an issue.

logback.xml is parsed at build time, so the overhead is minimised as much as possible. Even so we recommend that you only use this if you have a specific need for an appender that is not provided by jboss-logmanager, as including two different logging systems will always add overhead.

This requires the upcoming 2.1.0.Final release, as it requires some capabilities that were not in 2.0.0.Final.

Stuart

Stephane Epardaud

unread,
Jul 26, 2021, 3:55:06 AM7/26/21
to Stuart Douglas, Quarkus Development mailing list
Great news!

Since this is the first quarkiverse extension I look at, where do I go to view its docs, if not from its source code?

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2cxg%2B7OWGG_9jodjTzYsAL16Dy%2BLK3fb4nGDWU0yFXsD1A%40mail.gmail.com.


--
Stéphane Épardaud

George Gastaldi

unread,
Jul 26, 2021, 5:59:35 AM7/26/21
to Stephane Epardaud, Stuart Douglas, Quarkus Development mailing list

Erin Schnabel

unread,
Jul 26, 2021, 9:55:23 AM7/26/21
to George Gastaldi, Stephane Epardaud, Stuart Douglas, Quarkus Development mailing list
could/should be linked from the repo as its website (I did that for micrometer, but not all have or do.. )

Stephane Epardaud

unread,
Jul 26, 2021, 10:41:38 AM7/26/21
to Erin Schnabel, George Gastaldi, Stuart Douglas, Quarkus Development mailing list
Thanks. I don't see from the docs how I can configure Logback, is there support in quarkus config, or an external file, or am I missing something obvious to existing Logback users?
--
Stéphane Épardaud

Stuart Douglas

unread,
Jul 26, 2021, 1:55:06 PM7/26/21
to Stephane Epardaud, Erin Schnabel, George Gastaldi, Quarkus Development mailing list
You add logback.xml, it's literally the first line of the docs :-)

If you don't really know about logback.xml then you should just be using normal quarkus logging I think. You should only use this if you really need something from logback, and in that case you should know how to configure it.

Stuart

Stephane Epardaud

unread,
Jul 27, 2021, 3:49:49 AM7/27/21
to Stuart Douglas, Erin Schnabel, George Gastaldi, Quarkus Development mailing list
It is indeed the first line, and I didn't even notice it because there are no examples of such a minimal file, nor any links to docs of it and not even links to Logback. So, IMO this looks very much like the docs someone would write if they wanted to get rid of a problematic use-case while encouraging people not to go down that way ;)
--
Stéphane Épardaud

Sérgio Sousa

unread,
Aug 4, 2021, 4:57:03 PM8/4/21
to stephane...@gmail.com, Stuart Douglas, Erin Schnabel, George Gastaldi, Quarkus Development mailing list
Hi!

Since I'm in the process of upgrading to 2.1.x, and I had a "dirty" hack to use logback (I need to use SiftingAppender to generate file logs per threads / processes), I thought to give this extension a go. The problem I have is that my files using the ch.qos.logback.classic.sift.SiftingAppender are not created / generated.

I tested the simple example in my logback.xml with ch.qos.logback.core.FileAppender and it works just fine. My question is: Am I missing something in configurations or others? Does ch.qos.logback.classic.sift.SiftingAppender supported?

Thanks in advance!

Best regards,

Sérgio Sousa


Stuart Douglas

unread,
Aug 4, 2021, 5:16:14 PM8/4/21
to Sérgio Sousa, Stephane Epardaud, Erin Schnabel, George Gastaldi, Quarkus Development mailing list
Do you have a reproducer I can test?

Stuart

Sérgio Sousa

unread,
Aug 4, 2021, 6:06:11 PM8/4/21
to Stuart Douglas, Stephane Epardaud, Erin Schnabel, George Gastaldi, Quarkus Development mailing list
Yes, here it is: https://github.com/seseso/quarkus-logback-siftingappender

hitting a curl to the default resource (http://localhost:8080/hello) triggers some logs.

As is, the test.log file is created but neither of the sifting_XXX.log (nor original one sifting.log for that matter) are created.

If you need anything else, please let me know.

Best regards,

Sérgio Sousa

Stuart Douglas

unread,
Aug 5, 2021, 4:00:31 AM8/5/21
to Sérgio Sousa, Stephane Epardaud, Erin Schnabel, George Gastaldi, Quarkus Development mailing list
Try with 0.3.0 and it should work (might take a while to hit central though, I only just hit the button). I also upped the version to 2.1.1.Final.

Stuart

Sérgio Sousa

unread,
Aug 5, 2021, 6:03:39 AM8/5/21
to Stuart Douglas, Stephane Epardaud, Erin Schnabel, George Gastaldi, Quarkus Development mailing list
It worked!

Thanks!

Sérgio Sousa

Reply all
Reply to author
Forward
0 new messages