I am trying to group logs of multiple related applications to a single log file.

For example I have 3 applications A1.esb, A2.esb, A3.esb.

I want all the logs from these 3 applications get logged to a single log file called A.log.

Similarly, I want B.log for B1.esb, B2.esb and B3.esb.

I am using log4j in JBoss application server.

I have tried to use TCLFilter but I only succeeded in getting individual applications logging to individual log files. As in, A1.esb logging to A1.log, A2.esb logging to A2.log and so on. But I couldn't figure out a way of grouping these loggings.