logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1244) Make header and footer values customizable in JSONLayout
Date Tue, 05 Jan 2016 22:28:39 GMT

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

Remko Popma commented on LOG4J2-1244:

If we support [Lookups|http://logging.apache.org/log4j/2.x/manual/lookups.html] in the header
and footer, the above request can be accomplished with the built-in [System Properties Lookup|http://logging.apache.org/log4j/2.x/manual/lookups.html#SystemPropertiesLookup]
while still giving flexibility to users with other needs.

> Make header and footer values customizable in JSONLayout
> --------------------------------------------------------
>                 Key: LOG4J2-1244
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1244
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Layouts
>            Reporter: Anshu Garg
>            Assignee: Gary Gregory
> It will be helpful to provide a way to customize header and footer in JSONLayout in Log4j
> For instance user is writing a logging application which logs requests and responses
to/from a server to log files in JSON format. Now user also wants to log server specific information
in each log file but since it will be common for all request/response, it is not desired to
be logged with each log entry so user wants to add server specific common information at start
of the file. As header in JSON format or in this use case. This will be followed by each request
and response logged as a JSON array element. And at rollover this JSON array and main JSON
object  (which contains header and JSON array) should  be closed with help of footer.
> A typical file will be something like ...
> {"Header":{"ServerName":"MyAppServer"},"LogEntries":[{"Message":"Request message1","RequestingAddress":"","TimeStamp":"2016-01-05_07-24-59"},
> {"Message":"Request message1","RequestingAddress":"","TimeStamp":"2016-01-05_07-24-59"},
> {"Message":"Request message1","RequestingAddress":"","TimeStamp":"2016-01-05_07-24-59"},
> {"LogEndMarker":"END"}]}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

View raw message