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. Additionally, Apache Log4j 2 has a notion of Log Messages that is documented at https://logging.apache.org/log4j/2.0/manual/messages.html So, if you really have this requirement, you can implement your custom Message objects and then log those. HTH On Thu, May 7, 2015 at 3:14 PM, Chathura Priyankara <[email protected] > wrote: > 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 <[email protected]> wrote: > >> Hi, >> >> What is the customization that you wanna apply? >> >> Cheers, >> Behrooz >> >> >> On Thu, May 7, 2015 at 1:26 PM, Chathura Priyankara < >> [email protected]> 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 >>> this. >>> >>> [1] https://logging.apache.org/log4j/2.x/manual/extending.html#Appenders >>> >>> Can anyone provide me a sample for this ? (both configuration and custom >>> appender) >>> >>> Any help is appreciated. >>> >>> Thanks! >>> >>> -- >>> Chathura Priyankara, >>> Faculty of Information Technology, >>> University of Moratuwa. >>> Blog : www.codeoncloud.blogspot.com >>> >> >> >> >> -- >> -- Behrooz Nobakht >> > > > > -- > Chathura Priyankara, > Faculty of Information Technology, > University of Moratuwa. > Blog : www.codeoncloud.blogspot.com > -- -- Behrooz Nobakht
