ppkarwasz commented on code in PR #836:
URL: https://github.com/apache/logging-log4j2/pull/836#discussion_r869474731
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java:
##########
@@ -610,8 +610,8 @@ public static Rfc5424Layout createLayout(
// @formatter:off
@PluginAttribute(value = "facility", defaultString = "LOCAL0")
final Facility facility,
@PluginAttribute("id") final String id,
- @PluginAttribute(value = "enterpriseNumber", defaultInt =
DEFAULT_ENTERPRISE_NUMBER)
- final int enterpriseNumber,
+ @PluginAttribute(value = "enterpriseNumber", defaultString =
DEFAULT_ENTERPRISE_NUMBER)
+ final String enterpriseNumber,
Review Comment:
To change the type of the `enterpriseNumber` parameter, you would need to
introduce a new factory method. The current practice in Log4j is to gradually
migrate to builders: every time a new factory method would be required, we
create a builder instead.
The current convention for builders is to name the methods `set*` (not
`with*` as in some previous code).
I would expect the `enterpriseNumber` parameter to be validated against the
`\d+(\.\d+)*` regex. If the validation fails a warning should be written to the
status logger and `null` should be returned.
--
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]