Re: [Dev][log4j2]Create custom console appender

2015-05-07 Thread Chathura Priyankara
Hi Remko, Thank you very much for the explanation. That was exactly what I needed. I think it is better if those information can be included the log4j2 documentation in the migrating from log4j 1.2 section because most of the applications are still using log4j 1.2.x and need to convert to log4j2.

Re: [Dev][log4j2]Create custom console appender

2015-05-07 Thread Remko Popma
Thanks for the additional detail. With log4j-1.x, a custom appender may have been the best solution, but it sounds like log4j2's built-in features provide all you need. If your application calls ThreadContext.put("serviceId", getServiceId()); ThreadContext.put("serviceName", getServiceName());

Re: [Dev][log4j2]Create custom console appender

2015-05-07 Thread Chathura Priyankara
Hi All, Thank you for the replies. Currently I'm migrating a large application from log4j 1.2.17 to log4j 2.2. That application has custom console appender which takes logging event and create custom logging events with some additional application specific data such as service id, service name etc

Re: [Dev][log4j2]Create custom console appender

2015-05-07 Thread Remko Popma
You may not need to write a custom appender. Have you looked at the ThreadContext map? Your application threads can put key-value pairs in that map, and following that, all log events generated by that thread will carry those key-value pairs. You can output the values with the %X pattern in your

Re: [Dev][log4j2]Create custom console appender

2015-05-07 Thread Behrooz Nobakht
I have a feeling that with a bit of proper class and logger hierarchy you can utilize the current facilities in Apache Log4j 2 at https://logging.apache.org/log4j/2.0/manual/api.html which requires you to have appropriate log message formats and then feed them with you application specific data.

[jira] [Commented] (LOG4J2-435) Support limiting number of log files based on date pattern

2015-05-07 Thread Robert Schaft (JIRA)
[ https://issues.apache.org/jira/browse/LOG4J2-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14532935#comment-14532935 ] Robert Schaft commented on LOG4J2-435: -- >From my point of view a date pattern {{%d}}

Re: [Dev][log4j2]Create custom console appender

2015-05-07 Thread Chathura Priyankara
Hi Beharooz, I want to log some application specific data such as domain, userid etc using custom console appender. Is this possible ? Thanks! On Thu, May 7, 2015 at 5:20 PM, Behrooz Nobakht wrote: > Hi, > > What is the customization that you wanna apply? > > Cheers, > Behrooz > > > On Thu, Ma

[jira] [Updated] (LOG4J2-945) Reconfiguring statusLogger to a higher level doesn't work correctly

2015-05-07 Thread Stefan Wehner (JIRA)
[ https://issues.apache.org/jira/browse/LOG4J2-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Wehner updated LOG4J2-945: - Attachment: StatusLoggerBenchmark.java log4j2-status-perf.xml > Reconfiguring stat

[jira] [Commented] (LOG4J2-945) Reconfiguring statusLogger to a higher level doesn't work correctly

2015-05-07 Thread Stefan Wehner (JIRA)
[ https://issues.apache.org/jira/browse/LOG4J2-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14532571#comment-14532571 ] Stefan Wehner commented on LOG4J2-945: -- Hey, I'm not sure how to test this exactly -

Re: [Dev][log4j2]Create custom console appender

2015-05-07 Thread Behrooz Nobakht
Hi, What is the customization that you wanna apply? Cheers, Behrooz On Thu, May 7, 2015 at 1:26 PM, Chathura Priyankara wrote: > Hi devs, > > I want to create a custom console appender for log4j2 but I cannot find > any resource or sample about this. The only resource [1] is not enough for >

[Dev][log4j2]Create custom console appender

2015-05-07 Thread Chathura Priyankara
Hi devs, I want to create a custom console appender for log4j2 but I cannot find any resource or sample about this. The only resource [1] is not enough for this. [1] https://logging.apache.org/log4j/2.x/manual/extending.html#Appenders Can anyone provide me a sample for this ? (both configuration

[jira] [Commented] (LOG4J2-888) Specifying log4jConfiguration in web.xml fails on Windows when the file's path contains spaces

2015-05-07 Thread Jens Granseuer (JIRA)
[ https://issues.apache.org/jira/browse/LOG4J2-888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14532340#comment-14532340 ] Jens Granseuer commented on LOG4J2-888: --- The same issue also crops up if you specify