vy commented on code in PR #2322:
URL: https://github.com/apache/logging-log4j2/pull/2322#discussion_r1504105536
##########
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java:
##########
@@ -251,7 +276,13 @@ private static Level readFallbackListenerLevel(final
Properties fileProvidedProp
private static DateTimeFormatter readInstantFormatter(final Properties
fileProvidedProperties) {
final String format = readProperty(fileProvidedProperties,
STATUS_DATE_FORMAT);
- return format != null ? DateTimeFormatter.ofPattern(format) : null;
+ if (format == null) {
+ return null;
+ }
+ final DateTimeFormatter formatter =
DateTimeFormatter.ofPattern(format);
+ final String zoneId = readProperty(fileProvidedProperties,
STATUS_DATE_FORMAT_ZONE);
+ final ZoneId effectiveZoneId = zoneId != null ? ZoneId.of(zoneId)
: ZoneId.systemDefault();
Review Comment:
I've extensively improved such checks along with tests. Could you check it
again, please?
##########
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java:
##########
@@ -158,11 +162,26 @@ public class StatusLogger extends AbstractLogger {
/**
* The name of the system property that can be configured with a {@link
java.time.format.DateTimeFormatter} pattern that will be used while formatting
the created {@link StatusData}.
+ * <p>
+ * When not provided, {@link Instant#toString()} will be used.
+ * </p>
*
+ * @see #STATUS_DATE_FORMAT_ZONE
* @since 2.11.0
*/
public static final String STATUS_DATE_FORMAT =
"log4j2.StatusLogger.DateFormat";
Review Comment:
I've pushed a fix for this. Could you check it again, please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]