Custom PatternLayout and Custom PatternParser not working when deployed in jboss
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sandeep_Kannur
Posted On:   Monday, January 4, 2010 08:58 AM

Hi Folks, I have a specific requirement for logs. Requirement: I need the log message to appear in certain format with the ID. format is : "UNIQUE_ID DATE LOG_LEVEL MESSAGE_RELATED_TO_ID" test.log 1001I 1/4 INFO Please log in 2001E 1/4 ERROR Invalid email ID code: log.error("2001E"+"Please log in"); Since, log API supports the error(Object) / error(Object, Throwable). If we append the ID+Message, it will not appear in our required format. Analysis: 1) We need to split the message to get the logs in the above mentione   More>>

Hi Folks,


I have a specific requirement for logs.


Requirement: I need the log message to appear in certain format with the ID.


format is : "UNIQUE_ID DATE LOG_LEVEL MESSAGE_RELATED_TO_ID"




test.log

1001I 1/4 INFO Please log in

2001E 1/4 ERROR Invalid email ID



code: log.error("2001E"+"Please log in");





Since, log API supports the error(Object) / error(Object, Throwable).
If we append the ID+Message, it will not appear in our required format.





Analysis:

1) We need to split the message to get the logs in the above mentioned format.


Solution we tried:

1) I tried to extend the PatternLayout and PatternParser and override the convert method



Issues:

1) It works fine in the local environment, but fails to log the same when making the network calls.

2) We dubugged the same for network calls (ie when deployed in jboss server), and found that the
data (LoggingEvent) is coming as a complete String, and forcing us to Split the string (which is undesirable)




If you came across such issues please let me know.
Any help would be appreciated.



Thanks,

Sandeep    <<Less
About | Sitemap | Contact