You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/01/05 17:44:59 UTC

[GitHub] [logging-log4j2] atulpendse opened a new pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

atulpendse opened a new pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683


   This pull request is to imlement RFE LOG4J2-3280
   The change 
     - Adds new attribute timestampPrecision to Rfc5424Layout and SyslogAppender.
     - Replaces existing logic to append timestamp and uses two new fixed date formats to format timestamp.
     - Added new unit tests
     - Verified that 'mvn clean install' and 'mvn verify' are successful.
    


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1009618838


   Commit fbccefc updates existing test for SyslogAppender


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse edited a comment on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse edited a comment on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1008543504


   @vy 
   Thanks for taking time to review the PR.
   Here are my thoughts about questions you raised.
   
   > I am also not sure if a `timestampPrecision` argument of type `String` is the right way to go. Thinking out loudly:
   > 
   > * Why don't we simply make the instant formatting pattern configurable?
   
   With making pattern configurable, there is risk of the message not being compliant to RFC5424 spec (if someone updates format that is not as per RFC5424)
   
   > * Doesn't the spec enforce a certain precision?
   
   The spec does not enforce 'a particular' precision, rather it supports three precisions
   
   1. Without any sub-second value
   2. Milliseconds
   3. Microseconds
   
   
   > * If not, why don't we simply (automatically?) pick the most precise representation possible?
   
   We could, that would work for my usecase. But if someone is expecting precision to be millisecond (like my app was expecting it to be microsecond), it would break their app.
   
   I will add a test for SyslogAppender.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1057728562


   Just FYI.. I was able to build it successfully on my Mac. Last time @garydgregory tried to submit build with this PR, it failed on Mac, not sure why.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1006322842


   I believe the failure in PropertiesConfigurationTest is unrelated to this change, and being fixed with #685 
   Once that is fixed, how do I get this PR to build and run CI tests again?


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r785986466



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -300,6 +307,11 @@ public B setLoggerFields(final LoggerFields[] loggerFields) {
             this.loggerFields = loggerFields;
             return asBuilder();
         }
+
+		public B setTimestampPrecision(final String timestampPrecision) {

Review comment:
       This indentation looks messed up. Spaces, no tabs, could be the issue?

##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
##########
@@ -270,7 +278,7 @@ private static PatternParser createPatternParser(final Configuration config,
     public String toSerializable(final LogEvent event) {
         final StringBuilder buf = getStringBuilder();
         appendPriority(buf, event.getLevel());
-        appendTimestamp(buf, event.getTimeMillis());
+		appendTimestamp(buf, event.getInstant());

Review comment:
       No tabs.

##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -425,6 +440,7 @@ protected SyslogAppender(final String name, final Layout<? extends Serializable>
                 .setCharsetName(charset)
                 .setExceptionPattern(exceptionPattern)
                 .setLoggerFields(loggerFields)
+                .setTimestampPrecision( timestampPrecision )

Review comment:
       No spaces around an argument, please follow the style of the file you're in!
   `.setTimestampPrecision( timestampPrecision )` -> `.setTimestampPrecision(timestampPrecision)`

##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -211,6 +214,10 @@ public String getExceptionPattern() {
             return loggerFields;
         }
 
+		public String getTimestampPrecision() {

Review comment:
       This indentation looks messed up. Spaces, no tabs, could be the issue?

##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -104,6 +104,9 @@
         @PluginElement("LoggerFields")
         private LoggerFields[] loggerFields;
 
+        @PluginBuilderAttribute( "timestampPrecision" )
+        private String timestampPrecision;

Review comment:
       Shouldn't we use an enum here?




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r836438381



##########
File path: log4j-core/revapi.json
##########
@@ -128,6 +128,25 @@
         "annotation": "@org.apache.logging.log4j.core.config.plugins.PluginFactory",
         "justification": "LOG4J2-3317: Fix RoutingAppender backcompat while improving lookup security"
       },
+      {
+        "code": "java.method.numberOfParametersChanged",

Review comment:
       I am sorry, I think I do not understand which method you are referring. Do you want me to deprecate old Rfc5424Layout.createLayout() and create a new one with updated signature?




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1018735056


   Looks like a test is failing on MacOS. Failure doesn't look related to my changes though. I don't have access to Mac to find out why exactly it's failing.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] ppkarwasz commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
ppkarwasz commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r837730815



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
##########
@@ -92,11 +97,12 @@
      */
     public static final String DEFAULT_MDCID = "mdc";
 
+    private static final FixedDateFormat FIXED_DATE_FORMAT_MILLI_PRECISION = FixedDateFormat
+            .create(FixedFormat.ISO8601_OFFSET_DATE_TIME_HHCMM_PERIOD);
+    private static final FixedDateFormat FIXED_DATE_FORMAT_MICRO_PRECISION = FixedDateFormat
+            .create(FixedFormat.ISO8601_OFFSET_DATE_TIME_HHCMM_PERIOD_MICRO);
+

Review comment:
       I would use a (non static) `org.apache.logging.log4j.core.pattern.DatePatternConverter` to keep the layout garbage free.
   Otherwise, you might use a (non static) character array, to serialize timestamps without creating new `String` objects.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1081036428


   Hello @atulpendse 
   In general, you want to avoid breaking binary compatibility,  so that means not editing public and protected type names and method signatures. This is critical in the log4j-api module and less so in others, but, in this case it seems easy to do. Also, we have been switching from factory methods to builders as we go from release to release in order to avoid keeping on deprecating factory methods. So edit or add builders, don't edit factory methods is the idea. TY!


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1006572274


   > Hi @atulpendse
   > You will need to rebase this PR to pick up the latest changes.
   
   Thanks for the info. I have updated PR with the latest from upstream. Latest commit seems to have passed all the tests.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1008543504


   @vy 
   Thanks for taking time to review the PR.
   Here are my thoughts about questions you raised.
   
   > I am also not sure if a `timestampPrecision` argument of type `String` is the right way to go. Thinking out loudly:
   > 
   > * Why don't we simply make the instant formatting pattern configurable?
   
   With making pattern configuration, there is risk of the message not being compliant to RFC5424 spec (if someone updates format that is not as per RFC5424)
   
   > * Doesn't the spec enforce a certain precision?
   
   The spec does not enforce 'a particular' precision, rather it supports three precisions
   
   1. Without any sub-second value
   2. Milliseconds
   3. Microseconds
   
   
   > * If not, why don't we simply (automatically?) pick the most precise representation possible?
   
   We could, that would work for my usecase. But if someone is expecting precision to be millisecond (like my app was expecting it to be microsecond), it would break their app.
   
   I will add a test for SyslogAppender.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] ppkarwasz commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
ppkarwasz commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r837730815



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
##########
@@ -92,11 +97,12 @@
      */
     public static final String DEFAULT_MDCID = "mdc";
 
+    private static final FixedDateFormat FIXED_DATE_FORMAT_MILLI_PRECISION = FixedDateFormat
+            .create(FixedFormat.ISO8601_OFFSET_DATE_TIME_HHCMM_PERIOD);
+    private static final FixedDateFormat FIXED_DATE_FORMAT_MICRO_PRECISION = FixedDateFormat
+            .create(FixedFormat.ISO8601_OFFSET_DATE_TIME_HHCMM_PERIOD_MICRO);
+

Review comment:
       I would use a (non static) `org.apache.logging.log4j.core.pattern.DatePatternConverter` to keep the layout garbage free.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r788637972



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -425,6 +440,7 @@ protected SyslogAppender(final String name, final Layout<? extends Serializable>
                 .setCharsetName(charset)
                 .setExceptionPattern(exceptionPattern)
                 .setLoggerFields(loggerFields)
+                .setTimestampPrecision( timestampPrecision )

Review comment:
       I have fixed it with latest commit.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] vy edited a comment on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
vy edited a comment on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1008421459


   Fantastic work @atulpendse! Thanks so much!
   
   Mind adding `SyslogAppender` tests ~~and a `changes.xml` entry~~, please?
   
   I am also not sure if a `timestampPrecision` argument of type `String` is the right way to go. Thinking out loudly:
   - Why don't we simply make the instant formatting pattern configurable?
   - Doesn't the spec enforce a certain precision?
   - If not, why don't we simply (automatically?) pick the most precise representation possible?


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r788638315



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
##########
@@ -270,7 +278,7 @@ private static PatternParser createPatternParser(final Configuration config,
     public String toSerializable(final LogEvent event) {
         final StringBuilder buf = getStringBuilder();
         appendPriority(buf, event.getLevel());
-        appendTimestamp(buf, event.getTimeMillis());
+		appendTimestamp(buf, event.getInstant());

Review comment:
       I have fixed it with latest commit.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] vy commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
vy commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1008432086


   IMHO, cherry-picking to `master` is almost already impossible. Nevertheless, I will rephrase my comment to exclude the `changes.xml` part.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r836438381



##########
File path: log4j-core/revapi.json
##########
@@ -128,6 +128,25 @@
         "annotation": "@org.apache.logging.log4j.core.config.plugins.PluginFactory",
         "justification": "LOG4J2-3317: Fix RoutingAppender backcompat while improving lookup security"
       },
+      {
+        "code": "java.method.numberOfParametersChanged",

Review comment:
       I am sorry, I think I do not understand which method you are referring. Do you want me to deprecate old Rfc5424Layout.createLayout() and create a new one with updated signature? I have not removed any existing method.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r836762447



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
##########
@@ -627,7 +608,8 @@ public static Rfc5424Layout createLayout(
             // RFC 5425
             @PluginAttribute(value = "useTlsMessageFormat") final boolean useTlsMessageFormat,
             @PluginElement("LoggerFields") final LoggerFields[] loggerFields,
-            @PluginConfiguration final Configuration config) {
+            @PluginConfiguration final Configuration config,
+            @PluginAttribute(value = "timestampPrecision") final TimestampPrecision timestampPrecision) {

Review comment:
       Use a builder instead of breaking BC.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r837103493



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -393,7 +408,8 @@ protected SyslogAppender(final String name, final Layout<? extends Serializable>
             final Charset charset,
             final String exceptionPattern,
             final LoggerFields[] loggerFields,
-            final boolean advertise) {
+            final boolean advertise,
+            final TimestampPrecision timestampPrecision) {
         // @formatter:on

Review comment:
       I agree, but Rfc5424Layout does not have a builder which caller can use. It only supports creating instances via constructor.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r836407990



##########
File path: log4j-core/revapi.json
##########
@@ -128,6 +128,25 @@
         "annotation": "@org.apache.logging.log4j.core.config.plugins.PluginFactory",
         "justification": "LOG4J2-3317: Fix RoutingAppender backcompat while improving lookup security"
       },
+      {
+        "code": "java.method.numberOfParametersChanged",

Review comment:
       You should deprecate the old method, not remove it.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] vy commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
vy commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1008421459


   Fantastic work @atulpendse! Thanks so much!
   
   Mind adding `SyslogAppender` tests and a `changes.xml` entry, please?
   
   I am also not sure if a `timestampPrecision` argument of type `String` is the right way to go. Thinking out loudly:
   - Why don't we simply make the instant formatting pattern configurable?
   - Doesn't the spec enforce a certain precision?
   - If not, why don't we simply (automatically?) pick the most precise representation possible?


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r788639623



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -104,6 +104,9 @@
         @PluginElement("LoggerFields")
         private LoggerFields[] loggerFields;
 
+        @PluginBuilderAttribute( "timestampPrecision" )
+        private String timestampPrecision;

Review comment:
       I have converted it into an enum with latest commit.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1017493771


   > I only took a cursory look this AM. Please use the style of the files you are editing: Use spaces, no tabs. The bigger question is whether we should use an enum for the microsecond vs millisecond format, @jvz any thoughts?
   
   Thanks for taking time to review. I have fixed the concerns with latest commit. Now timestampPrecision is an enum.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1014358483


   @vy @garydgregory anything else that I should do to make progress on this PR?


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] atulpendse commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
atulpendse commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r788637603



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -211,6 +214,10 @@ public String getExceptionPattern() {
             return loggerFields;
         }
 
+		public String getTimestampPrecision() {

Review comment:
       Yeah.. issue due to tabs. Was due to problem with my eclipse formatter setting. I have fixed it with latest commit.

##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -300,6 +307,11 @@ public B setLoggerFields(final LoggerFields[] loggerFields) {
             this.loggerFields = loggerFields;
             return asBuilder();
         }
+
+		public B setTimestampPrecision(final String timestampPrecision) {

Review comment:
       I have fixed it with latest commit.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r836761436



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -393,7 +408,8 @@ protected SyslogAppender(final String name, final Layout<? extends Serializable>
             final Charset charset,
             final String exceptionPattern,
             final LoggerFields[] loggerFields,
-            final boolean advertise) {
+            final boolean advertise,
+            final TimestampPrecision timestampPrecision) {
         // @formatter:on

Review comment:
       No need to edit this method which breaks BC, call sites should use the builder.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1006563262


   Hi @atulpendse
   You will need to rebase this PR to pick up the latest changes.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#issuecomment-1008430785


   I would NOT update changes.xml, this makes cherry-picking the commit to master impossible. 


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] jvz commented on a change in pull request #683: LOG4J2-3280 - Add support for microsecond precision in RFC5424Layout

Posted by GitBox <gi...@apache.org>.
jvz commented on a change in pull request #683:
URL: https://github.com/apache/logging-log4j2/pull/683#discussion_r786137086



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
##########
@@ -104,6 +104,9 @@
         @PluginElement("LoggerFields")
         private LoggerFields[] loggerFields;
 
+        @PluginBuilderAttribute( "timestampPrecision" )
+        private String timestampPrecision;

Review comment:
       I agree. An enum would make sense.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org