You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/04/27 16:10:04 UTC

[jira] [Commented] (LOG4J2-1694) Allow to easily add fields with fixed values to JSON output

    [ https://issues.apache.org/jira/browse/LOG4J2-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15986904#comment-15986904 ] 

ASF subversion and git services commented on LOG4J2-1694:
---------------------------------------------------------

Commit 9383ab7c2fafce6005df6e97ee25ae700b71502a in logging-log4j2's branch refs/heads/LOG4J2-1694 from [~mikaelstaldal]
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=9383ab7 ]

LOG4J2-1694 Update changes


> Allow to easily add fields with fixed values to JSON output
> -----------------------------------------------------------
>
>                 Key: LOG4J2-1694
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1694
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Layouts
>    Affects Versions: 2.7
>            Reporter: Raimar Falke
>            Assignee: Mikael Ståldal
>              Labels: extra-field, json
>
> The Logback JSON Encoder has a feature which allows to specify JSON fields with fixed values. Link: https://github.com/logstash/logstash-logback-encoder#loggingevent_custom_global
> Example:
> {noformat}
> <encoder class="net.logstash.logback.encoder.LogstashEncoder">
>   <customFields>{"appname":"myWebservice","roles":["customerorder","auth"],"buildinfo":{"version":"Version 0.1.0-SNAPSHOT","lastcommit":"75473700d5befa953c45f630c6d9105413c16fe1"}}</customFields>
> </encoder>
> {noformat}
> This is a very convenient way to specify fixed attributes like application, service or environment.
> So far I don't see such a possibility in log4j. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)