-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Locale for String formatting #87
Comments
What are the expected values for your examples? |
Well, Latin numbers. Something like 2015-02-19 etc. If there were a locale, I'd probably pick Locale.US. |
Are you saying the locale should be hard-coded to US? You mentioned partial right-to-left (and I'm not sure what the full line is supposed to look like), so I'm a little confused. |
No. What I meant is: Whenever there is any String formatting we need a way to supply a locale. I personally will set this locale to Locale.US for all of my apps. I can imagine devs from "non-latin-number countries" may decide different. |
Regarding RTL: try cut & paste (or even just text selection) on my first comment #87 (comment) , second to last line. You'll see it's mixed LTR/RTL. |
I'm also facing this problem. 2015-07-13 16:48:25.823+0800 [Thread-128] DEBUG not like this ٢٠١٥-٠٩-٠٣ ٠٩:٠٢:٤٢.٤٩٥+0400 [main] INFO |
The date conversion pattern previously assumed the system default locale, which caused undesired localization of dates in logs (where log lines would be partially translated). This patch defaults the locale to US/English so that the dates and logs are presented in a consistent form.
The date conversion pattern now accepts a locale option (in the third option position). Examples: %d{HH:mm:ss,EST,fr} %d{HH:mm:ss,EST,"zh,CN"} %d{HH:mm:ss,EST,"hi,IN"}
The locale can now be specified in date conversion patterns in the third option position. By default, the US/English locale is assumed. Examples:
|
Released in 1.1.1-5 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Whenever there is any String formatting we need a way to supply a Locale.
e.g. I use filePattern.setPattern("%d{HH:mm:ss.SSS} [%thread]"); and in the Arabic world this yields log lines like this:
١٨:٣٧:١١.٧٢٧ [main] …
A similar thing happens for the filenames of rolling logs:
rollingPolicy.setFileNamePattern("/%d.log.gz");
yields files named like this:
٢٠١٥-٠٢-١٦.-1847019678.log.gz
You may notice these filenames are writting from right to left partially. (-:
The text was updated successfully, but these errors were encountered: