What is run.log and can we safely delete it?

Document ID : KB000072266
Last Modified Date : 27/02/2018
Show Technical Document Details
Introduction:
We have noticed that <jboss>\bin\run.log is very large, GBs in size. What is run.log and can we safely delete it?
Instructions:
run.log is the console output from the jboss service. This includes everything written to stdout and stderr. By default this also includes everything PIM writes to server.log.

<jboss>\bin\run.log can be safely deleted, but the "JBoss Application Server 4.2.3" service needs to be stopped first.

You can stop logging the PIM related information that is also written to server.log like so:

1) Make a backup copy of <jboss>\server\default\conf\jboss-log4j.xml. This needs to be outside of the JBoss folder tree to ensure that it is not picked up as a configuration file.

2) Edit <jboss>\server\default\conf\jboss-log4j.xml

Find:
<!-- ============================== -->
   <!-- Append messages to the console -->
   <!-- ============================== -->

   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
      <param name="Target" value="System.out"/>
      <param name="Threshold" value="INFO"/>

      <layout class="org.apache.log4j.PatternLayout">
         <!-- The default pattern: Date Priority [Category] Message\n -->
         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
      </layout>
   </appender>
And comment it out so that it looks like:
<!-- ============================== -->
   <!-- Append messages to the console -->
   <!-- ============================== -->
<!--
   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
      <param name="Target" value="System.out"/>
      <param name="Threshold" value="INFO"/>

      <layout class="org.apache.log4j.PatternLayout">
-->
         <!-- The default pattern: Date Priority [Category] Message\n -->
<!--
         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
      </layout>
   </appender>
-->
Find:
<!-- ======================= -->
   <!-- Setup the Root category -->
   <!-- ======================= -->

   <root>
      <appender-ref ref="CONSOLE"/>
      <appender-ref ref="FILE"/>
   </root>
And comment out <appender-ref ref="CONSOLE"/> so that it looks like:
<!-- ======================= -->
   <!-- Setup the Root category -->
   <!-- ======================= -->

   <root>
<!--
      <appender-ref ref="CONSOLE"/>
-->
      <appender-ref ref="FILE"/>
   </root>

3) wait a couple of minutes. Changes to jboss-log4j.xml are picked up by a job which executes every 60 seconds so you do not need to restart the "JBoss Application Server 4.2.3" service.