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 2021/08/17 23:09:08 UTC

[GitHub] [logging-log4j2] arVahedi opened a new pull request #562: Close jira issue LOG4J2-3138

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


   Add Enhanced json layout for defined dynamic class as model of json structure
   
   Signed-off-by: arVahedi <ar...@gmail.com>


-- 
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] arVahedi edited a comment on pull request #562: Close jira issue LOG4J2-3138

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


   > Why don't you simply use `JsonTemplateLayout`?
   > 
   > 
   > 
   
   `JsonTemplateLayout` is a great feature, but it is still limited. imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate a activityId, digest value or something like that at runtime. 
   the `EnhancedJsonLayout` offers you a full control on what you need to log. 


-- 
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 #562: Close jira issue LOG4J2-3138

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


   I will back at my desk in a week or so, then I will be able to review this
   PR. I'd appreciate holding this PR on hold until then.
   
   Alireza, are you sure you understand Carter's suggestion right? I am
   surprised at how promptly you concluded that it is not gonna work for you
   given that feature is yet to be released in 2.15.0. JTL's plugin support
   enables you to introduce any custom serialization logic within a method
   accepting a `LogEvent` and a 'JsonWriter`. I am curious what can be more
   easier and customizable than this.
   
   On Thu, 19 Aug 2021, 08:52 Alireza Vahedi ***@***.***> wrote:
   
   > imagine I need to log some value out of LogEvent context and based on some
   > logic at runtime, for example generate an activityId, digest value or
   > something like that at runtime.
   >
   > Couldn't you implement these using a custom TemplateResolver to define
   > additional components?
   >
   > Yes we can, but it is more complex way. I amaze why we have implemented
   > some complex approach instead of define just one model class as simplest
   > way we can to use.
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/logging-log4j2/pull/562#issuecomment-901630304>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAARTSLTQS6LRAPLSCCNXJ3T5SLZTANCNFSM5CK2VPRA>
   > .
   >
   


-- 
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] arVahedi edited a comment on pull request #562: Close jira issue LOG4J2-3138

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


   > Why don't you simply use `JsonTemplateLayout`?
   > 
   > 
   > 
   
   `JsonTemplateLayout` is a great feature, but it is still limited. imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate an activity id, digest value or something like that at runtime. 
   The `EnhancedJsonLayout` offers you a full control on what you need to log. 


-- 
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 #562: Close jira issue LOG4J2-3138

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


   Why don't you simply use `JsonTemplateLayout`?
   
   On Wed, 18 Aug 2021, 02:09 Alireza Vahedi ***@***.***> wrote:
   
   > Add Enhanced json layout for defined dynamic class as model of json
   > structure
   >
   > Signed-off-by: arVahedi ***@***.***
   > ------------------------------
   > You can view, comment on, or merge this pull request online at:
   >
   >   https://github.com/apache/logging-log4j2/pull/562
   > Commit Summary
   >
   >    - Close jira issue LOG4J2-3138
   >
   > File Changes
   >
   >    - *A*
   >    log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/EnhancedJsonJacksonFactory.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-2bb5ea46caac5348ee3004bcf6a425afcfba55dd338c4eb89b0f480a25689acc>
   >    (23)
   >    - *A*
   >    log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/EnhancedJsonLayout.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-d59581b9a099148b941846dfc3ee55b77a610ac237f6f826c49b0b1c68b60034>
   >    (132)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/AbstractEnhancedJacksonFactory.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-7296cf0eaee5f1fc60465c3d572e77fadbd0d232e7bc68cc7c6bd4086818dabe>
   >    (32)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/AbstractEnhancedJacksonLayout.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-6fe5da58aa42e680d794da05ab6a15060605387d74e2040e201cdc08aca44acd>
   >    (240)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/model/DefaultLogEventWrapper.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-ee680d10cee1ef0fe893037afd24134defa815e070238f7165fd57561024afc1>
   >    (24)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/model/JsonModelLogEventWrapper.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-8f33d792008b0a3559793b8ed9aa1d25b1e4677956067805db8155fe2f30329b>
   >    (29)
   >
   > Patch Links:
   >
   >    - https://github.com/apache/logging-log4j2/pull/562.patch
   >    - https://github.com/apache/logging-log4j2/pull/562.diff
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/logging-log4j2/pull/562>, or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAARTSJZVTNN2AJ7LTZC37DT5LTZBANCNFSM5CK2VPRA>
   > .
   >
   


-- 
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 closed pull request #562: Close jira issue LOG4J2-3138

Posted by GitBox <gi...@apache.org>.
vy closed pull request #562:
URL: https://github.com/apache/logging-log4j2/pull/562


   


-- 
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] arVahedi edited a comment on pull request #562: Close jira issue LOG4J2-3138

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


   > Why don't you simply use `JsonTemplateLayout`?
   > 
   > 
   > 
   
   `JsonTemplateLayout` is a great feature, but it is still limited. imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate an activityId, digest value or something like that at runtime. 
   The `EnhancedJsonLayout` offers you a full control on what you need to log. 


-- 
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] arVahedi edited a comment on pull request #562: Close jira issue LOG4J2-3138

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


   > > imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate an activityId, digest value or something like that at runtime.
   > 
   > Couldn't you implement these using a custom `TemplateResolver` to define additional components?
   
   Maybe, but it is more complex way. I amaze why we have implemented some complex approach instead of define just one model class as simplest way we can to use. 


-- 
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] arVahedi edited a comment on pull request #562: Close jira issue LOG4J2-3138

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


   > Why don't you simply use `JsonTemplateLayout`?
   > 
   > 
   > 
   
   `JsonTemplateLayout` is a great feature, but it is still limited. imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate an activityId, digest value or something like that at runtime. 
   the `EnhancedJsonLayout` offers you a full control on what you need to log. 


-- 
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 #562: Close jira issue LOG4J2-3138

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


   Why don't you simply use `JsonTemplateLayout`?
   
   On Wed, 18 Aug 2021, 02:09 Alireza Vahedi ***@***.***> wrote:
   
   > Add Enhanced json layout for defined dynamic class as model of json
   > structure
   >
   > Signed-off-by: arVahedi ***@***.***
   > ------------------------------
   > You can view, comment on, or merge this pull request online at:
   >
   >   https://github.com/apache/logging-log4j2/pull/562
   > Commit Summary
   >
   >    - Close jira issue LOG4J2-3138
   >
   > File Changes
   >
   >    - *A*
   >    log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/EnhancedJsonJacksonFactory.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-2bb5ea46caac5348ee3004bcf6a425afcfba55dd338c4eb89b0f480a25689acc>
   >    (23)
   >    - *A*
   >    log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/EnhancedJsonLayout.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-d59581b9a099148b941846dfc3ee55b77a610ac237f6f826c49b0b1c68b60034>
   >    (132)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/AbstractEnhancedJacksonFactory.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-7296cf0eaee5f1fc60465c3d572e77fadbd0d232e7bc68cc7c6bd4086818dabe>
   >    (32)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/AbstractEnhancedJacksonLayout.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-6fe5da58aa42e680d794da05ab6a15060605387d74e2040e201cdc08aca44acd>
   >    (240)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/model/DefaultLogEventWrapper.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-ee680d10cee1ef0fe893037afd24134defa815e070238f7165fd57561024afc1>
   >    (24)
   >    - *A*
   >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/model/JsonModelLogEventWrapper.java
   >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-8f33d792008b0a3559793b8ed9aa1d25b1e4677956067805db8155fe2f30329b>
   >    (29)
   >
   > Patch Links:
   >
   >    - https://github.com/apache/logging-log4j2/pull/562.patch
   >    - https://github.com/apache/logging-log4j2/pull/562.diff
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/logging-log4j2/pull/562>, or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAARTSJZVTNN2AJ7LTZC37DT5LTZBANCNFSM5CK2VPRA>
   > .
   >
   


-- 
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] carterkozak commented on pull request #562: Close jira issue LOG4J2-3138

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


   > imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate an activityId, digest value or something like that at runtime.
   
   Couldn't you implement these using a custom `TemplateResolver` to define additional components?


-- 
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] arVahedi commented on pull request #562: Close jira issue LOG4J2-3138

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


   > Why don't you simply use `JsonTemplateLayout`?
   > 
   > On Wed, 18 Aug 2021, 02:09 Alireza Vahedi ***@***.***> wrote:
   > 
   > > Add Enhanced json layout for defined dynamic class as model of json
   > > structure
   > >
   > > Signed-off-by: arVahedi ***@***.***
   > > ------------------------------
   > > You can view, comment on, or merge this pull request online at:
   > >
   > >   https://github.com/apache/logging-log4j2/pull/562
   > > Commit Summary
   > >
   > >    - Close jira issue LOG4J2-3138
   > >
   > > File Changes
   > >
   > >    - *A*
   > >    log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/EnhancedJsonJacksonFactory.java
   > >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-2bb5ea46caac5348ee3004bcf6a425afcfba55dd338c4eb89b0f480a25689acc>
   > >    (23)
   > >    - *A*
   > >    log4j-layout-jackson-json/src/main/java/org/apache/logging/log4j/jackson/json/layout/EnhancedJsonLayout.java
   > >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-d59581b9a099148b941846dfc3ee55b77a610ac237f6f826c49b0b1c68b60034>
   > >    (132)
   > >    - *A*
   > >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/AbstractEnhancedJacksonFactory.java
   > >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-7296cf0eaee5f1fc60465c3d572e77fadbd0d232e7bc68cc7c6bd4086818dabe>
   > >    (32)
   > >    - *A*
   > >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/AbstractEnhancedJacksonLayout.java
   > >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-6fe5da58aa42e680d794da05ab6a15060605387d74e2040e201cdc08aca44acd>
   > >    (240)
   > >    - *A*
   > >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/model/DefaultLogEventWrapper.java
   > >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-ee680d10cee1ef0fe893037afd24134defa815e070238f7165fd57561024afc1>
   > >    (24)
   > >    - *A*
   > >    log4j-layout-jackson/src/main/java/org/apache/logging/log4j/jackson/model/JsonModelLogEventWrapper.java
   > >    <https://github.com/apache/logging-log4j2/pull/562/files#diff-8f33d792008b0a3559793b8ed9aa1d25b1e4677956067805db8155fe2f30329b>
   > >    (29)
   > >
   > > Patch Links:
   > >
   > >    - https://github.com/apache/logging-log4j2/pull/562.patch
   > >    - https://github.com/apache/logging-log4j2/pull/562.diff
   > >
   > > —
   > > You are receiving this because you are subscribed to this thread.
   > > Reply to this email directly, view it on GitHub
   > > <https://github.com/apache/logging-log4j2/pull/562>, or unsubscribe
   > > <https://github.com/notifications/unsubscribe-auth/AAARTSJZVTNN2AJ7LTZC37DT5LTZBANCNFSM5CK2VPRA>
   > > .
   > >
   > 
   
   `JsonTemplateLayout` is a great feature, but it is still limited. imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate a activityId, digest value or something like that at runtime. 
   the `EnhancedJsonLayout` offers you a full control on what you need to log. 


-- 
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 #562: Close jira issue LOG4J2-3138

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


   I have just skimmed over the changes and I am totally against this PR. We already have 3 competing JSON layouts in the project: `GelfLayout`, `JsonLayout`, and its successor `JsonTemplateLayout`. Putting aside we will be introducing a feature bloat to the code base, I am still yet to see a single function this new layout incorporates that is not possible with `JsonTemplateLayout`.
   
   I will to close this PR and the JIRA ticket due to insufficient justification. Feel free to reopen them if you have objections.


-- 
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] arVahedi commented on pull request #562: Close jira issue LOG4J2-3138

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


   > > imagine I need to log some value out of LogEvent context and based on some logic at runtime, for example generate an activityId, digest value or something like that at runtime.
   > 
   > Couldn't you implement these using a custom `TemplateResolver` to define additional components?
   
   Yes we can, but it is more complex way. I amaze why we have implemented some complex approach instead of define just one model class as simplest way we can to use. 


-- 
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