-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Issue with Duration Parsing #1963
Comments
Thank you for catching this bug. As far as I can see, most invocations of this code (especially if the unit ends in @rgoers, this is only used in the Kubernetes plugin. Can we replace the entire logic with |
Since the only users of |
@ppkarwasz, if there are no other system properties that need a |
@vy, In Log4j Core there is no I can deprecate it and replace its usages with |
I was working on something unrelated and needed to parse a string like
10s
or10ms
, I did a quick search in my project and came up with:logging-log4j2/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
Lines 639 to 674 in b4986fe
I'm not sure if it is a bug, but when it finds the first matching suffix it should immediately return, other wise it always falls through to
SECONDS
for most of the covered cases and the order is slightly messed up as theSECONDS
could produce an early match forMINUTES
,HOURS
, andDAYS
.The text was updated successfully, but these errors were encountered: