Single log file for multiple webapps

Posted by Ashish Aggarwal on Stack Overflow See other posts from Stack Overflow or by Ashish Aggarwal
Published on 2014-05-27T07:01:30Z Indexed on 2014/05/30 9:27 UTC
Read the original article Hit count: 242

Filed under:
|
|

In my tomcat there are multiple webapps deployed and they communicate with each other. Currently they all have their own log file. But when there is some issue comes from call I have to 1st check with the app to whom I made a call and check log file of respective apps involved in the call. So I want that, as all apps is deployed in same tomcat and sharing a common log4j, if a call made to any app then all logs should be in a single log file and no matters how my webapps are involved all error comes from any webapp during the call should be in a single log file.

I have no idea how can I achieve this. So any help is appreciable.

Edited: I think my question is not cleared so updated with use case:

I have three webapps A, B, C having logs files as A.log, B.log and C.log.
I made two calls. 1st one to A (that internally calls C) and 2nd to B (that internally calls C). 
Now logging of first call must be in A.log (with the logs of every step performed inside the webapp c) and second call must be in B.log (with the logs of every step performed inside the webapp c). 

© Stack Overflow or respective owner

Related posts about java

Related posts about logging