quarkus-workshops icon indicating copy to clipboard operation
quarkus-workshops copied to clipboard

version is not printed in VersionRecorder

Open oliv37 opened this issue 3 years ago • 8 comments

I can't see the application version printed when using the version-extension in rest-villains

image

As you can see, the extension-version is present into the installed features, but the log INFO [io.qu.wo.su.ve.ru.VersionRecorder] (Quarkus Main Thread) Version: 1.0.0-SNAPSHOT is never printed.

Surprisingly, when adding a sysout in VersionRecorder.printVersion, the log becomes visible

public void printVersion(String version) {
  System.out.println("Hello World !");
  Logger.getLogger(VersionRecorder.class.getName()).infof("Version: %s", version);
}

image

I can't figure out what is going on, maybe this is related to my laptop (I use elementary os). I get the same behavior with both versions of quarkus 2.9.2.Final / 2.13.2.Final

oliv37 avatar Oct 16 '22 17:10 oliv37

@geoand didn't we have an issue like that, where the logging subsystem is initialized after the first logged messages? I was thinking we were collecting the messages and printed them after the initialization, but I may be wrong.

cescoffier avatar Oct 17 '22 06:10 cescoffier

We do collect the messages the in-memory and then dump them when logging becomes available. If we have a sample application that shows this problem in action, I can take a look

geoand avatar Oct 17 '22 06:10 geoand

It's related to the last part of the workshop.

You can reproduce the problem by starting rest-villain and set quarkus.version.enabled=true in application.properties

oliv37 avatar Oct 17 '22 08:10 oliv37

Thanks.

I'll try and have a look soon

geoand avatar Oct 20 '22 05:10 geoand

I've just updated the workshop to Quarkus 2.14.0 and the version is displayed ok. @oliv37 can you try with 2.14.0 please?

agoncal avatar Nov 15 '22 16:11 agoncal

@agoncal I just tried with the new version and I have the same problem.

Using System.out.println("Version: " + version); works, using Logger.getLogger(VersionRecorder.class.getName()).infof("Version: %s", version); doesn't work. It seems to be specific to my local environment, I don't really understand what is happening.

oliv37 avatar Nov 15 '22 19:11 oliv37

@oliv37 just to let you know that I've updated the code to Quarkus 2.15.3 (see #207) and the version is displayed ok. Can you check on your side with this new release?

agoncal avatar Jan 11 '23 13:01 agoncal

Still the same behavior on my side, it doesn't print anything when using the Logger. The version is correctly displayed when using System.out.println

oliv37 avatar Jan 14 '23 12:01 oliv37