Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging: support microseconds in %d log pattern #9679

Closed
rquinio opened this issue May 29, 2020 · 4 comments · Fixed by #33318
Closed

Logging: support microseconds in %d log pattern #9679

rquinio opened this issue May 29, 2020 · 4 comments · Fixed by #33318
Labels
kind/enhancement New feature or request
Milestone

Comments

@rquinio
Copy link
Contributor

rquinio commented May 29, 2020

Description

The current implementation is based on SimpleDateFormat and is limited to milliseconds (i.e. %d{SSSSSS} does not work and prefixes with 000).
https://github.com/jboss-logging/jboss-logmanager/blob/master/core/src/main/java/org/jboss/logmanager/formatters/Formatters.java#L443-L458

With Java 9+, OpenJDK added support for better precision than milliseconds/nano-of-second (https://bugs.openjdk.java.net/browse/JDK-8068730).

Quarkus being supersonic, its logging should support this ! :p

Implementation ideas

Since DateTimeFormatter was added in Java 8, maybe there's a fallback and it doesn't have to wait for Quarkus to drop Java 8 support ?

@rquinio rquinio added the kind/enhancement New feature or request label May 29, 2020
@gkfirst8
Copy link

This is also useful to match the format that AWS needs in awslogs-datetime-format. That is following Pythons logging format: https://strftime.org/ which expects 'Microseconds'.

@geoand
Copy link
Contributor

geoand commented Aug 30, 2023

@jamezp is this something that JBoss LogManager supports?

@jamezp
Copy link
Contributor

jamezp commented Aug 30, 2023

@geoand Once the log manager is updated to the 3.0.2.Final version that @dmlloyd is working on, then the %d pattern uses the java.time.format.DateTimeFormatter so the patterns supported there will work.

@geoand
Copy link
Contributor

geoand commented Aug 30, 2023

Excellent!

@quarkus-bot quarkus-bot bot added this to the 3.4 - main milestone Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants