Re: Fwd: Add json object to log4j2 when is JSONLayout

2017-08-12 Thread Jeus Geek
​​ certainly :D On Fri, Aug 11, 2017 at 10:40 PM, Gary Gregory wrote: > On Fri, Aug 11, 2017 at 10:12 AM, Matt Sicker wrote: > > > PR is pull request, as in a GitHub pull request. A patch file uploaded to > > JIRA also works. > > > > With a unit test

Re: Fwd: Add json object to log4j2 when is JSONLayout

2017-08-11 Thread Gary Gregory
Hi All, Let's find out what the use-case is from the user first. If the JSON is generated on the fly or without a backing model, it may not be possible to use Jackson. Also you are assuming the user is also using Jackson, which may not be the case. Gary On Fri, Aug 11, 2017 at 1:39 PM, Mikael

Re: Fwd: Add json object to log4j2 when is JSONLayout

2017-08-11 Thread Mikael Ståldal
Note that if we add such option to JsonLayout, then all log messages passed to that layout need to be well-formed JSON, otherwise the output will not be well-formed JSON. We would make it easy for the user to shoot himself in the foot. I think it would be better to create a new subclass of

Re: Fwd: Add json object to log4j2 when is JSONLayout

2017-08-11 Thread Gary Gregory
On Fri, Aug 11, 2017 at 10:12 AM, Matt Sicker wrote: > PR is pull request, as in a GitHub pull request. A patch file uploaded to > JIRA also works. > With a unit test :-) Gary > > On 11 August 2017 at 11:03, Jeus Geek wrote: > > > Hello > > > > Thank

Re: Fwd: Add json object to log4j2 when is JSONLayout

2017-08-11 Thread Jeus Geek
Hello Thank you for your response.. I don't understand what "PR" means, but I think your ​purpose was "property". However, my idea is to enable adding a property, such that special characters will not be replaced after configuration. I believe many others like me would like to have the

Re: Fwd: Add json object to log4j2 when is JSONLayout

2017-08-11 Thread Gary Gregory
Hello, The JSON layout outputs the log event in JSON, the event message is just a string in that event, in this case, it is escaped following the JSON rules to remain a string. If you want a JSON object back out of the event message you will have to parse it out of that string. Feel free to

Fwd: Add json object to log4j2 when is JSONLayout

2017-08-11 Thread Jeus Geek
i will show JSON object as a JSON object in log4j2 when is that configed JSONLayout . JSON object: {"line_id": 12,"play_name":"Jeus"} import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger; public class Main { private static final Logger LOGGER =