Question : Jboss is overwriting the actual logfile when restarted

Hello, we're using Jboss 4.2.3 and whenever Jboss is restarted, it overwrites the actual logfile. But we don't want that, we want it to either continue the logfile or rotate the logfile, preferring the first though. How to enable either of those?


Kind Regards, René

Answer : Jboss is overwriting the actual logfile when restarted

Hi,

This is the default behavior with JBoss. To correct this just locate your log4j.xml file at %JBOSS_HOME%/server/default/conf:

Locate the statement:



  |      
  |      
  |        
  |  
  |      
  |
  |      
  |        
  |      
        
  |    


To make your logfile be appended modfiy this line:

 

to

 

For log rotation modify this line:



into this:



So that it will rotate your logs once the size is 500KB (default) you can modify this valuea too. Don't forget to restart your JBoss server after the modification.

cheers,
K.
Random Solutions  
 
programming4us programming4us