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 =

Re: log4j2.properties file locked in Tomcat 8.0

2017-08-11 Thread Remko Popma
Also, what is your Log4j2 configuration? Some file appender configurations result in file locking. (Shameless plug) Every java main() method deserves http://picocli.info > On Aug 11, 2017, at 17:36, Bogdan wrote: > > Hello again, > > I have tested with the latest version

Re: log4j2.properties file locked in Tomcat 8.0

2017-08-11 Thread Remko Popma
Is this on Windows? Have you tried to find what file exactly is being locked with a tool like Process Explorer from SysExternals (now Microsoft): https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer (Shameless plug) Every java main() method deserves http://picocli.info > On

Re: log4j2.properties file locked in Tomcat 8.0

2017-08-11 Thread Bogdan
Hello again, I have tested with the latest version of log4j2, 2.8.2 and it seems that this is still happening. Any ideea on how could i work around this? We have a release today and apparently this bug is forcing us to revert to log4j1. Thank you! Bogdan On Thu, Aug 10, 2017 at 8:42 PM, Bogdan