I have developed a servlet that outputs the server.log file of my JBoss 7.1 for easier debugging.
What i want to do is to customize the output of JBoss and also display from which war each line of output is generated.
To understand better this is a sample output right now:
What i want is also to output something that will identify from which deployment this output is coming from.
After the URL in each output i noticed a number after the 7001 port that is different for each deployment, but don't know how to associate that with a war file....
Anyone has an idea how i can do that?
Thanks in advance
UPDATE
I found this on the web http://java.dzone.com/articles/configuring-logging-jboss about configuring JBoss but sadly is for another version. Here it explains how to have log4j create different log files per deployment. That would be the ultimate solution for me.
First of all, it seems (from the content of your logs) you are using System.out.println and System.err.println.
If you switch your logging to slf4j, log4j, commons-logging and of course jboss-logging (thank you James) will be able to see what package you are logging from.
Once you use a proper logging facility you can filter by category by editing configuration file.
Also the logging will show more readable i.e. :
I will assume you are using the standalone configuration in $JBOSS_HOME/standalone/configuration/standalone.xml
You need to find the logging subsystem
and create a new appender of type periodic-rotating-file-handler:
Then add the filter:
That should do the work.
If I am not mistaken you can also create appenders and category filters from the administration console and the CLI
Regards