Simon_Naunton

[PIM] You do not need to restart jboss after modifying <jboss>/server/default/conf/jboss-log4j.xml (JBoss 4.2.3GA)

Discussion created by Simon_Naunton Employee on Sep 23, 2016

Quick summary:

 

Jboss will pick up changes to <jboss>/server/default/conf/jboss-log4j.xml if you wait 60 seconds. You do not need to restart jboss to pick up changes to  <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"><param name="Threshold" value="INFO"/>.

 

 

Long version:

 

By default, in <jboss>/server/default/conf/jboss-service.xml look for the "Log4j Initialization" section then <attribute name="RefreshPeriod">. This parameter specifies how frequently in seconds, default is 60, that <jboss>/server/default/conf/jboss-log4j.xml is reloaded.

 

In <jboss>/server/default/conf/jboss-log4j.xml I already had TRACE set, i.e.:

 

   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">

                <param name="Threshold" value="TRACE"/>

 

So I logged in, and in server.log (note the DEBUG entries):

 

2016-09-23 10:34:31,450 INFO  [com.ca.ppm.event.impl.LoginEvent] Executing event: LoginEvent

2016-09-23 10:34:31,524 INFO  [com.ca.ppm.event.impl.LoginEvent] User superadmin attempted to login. Status=succeeded, Client IP=<ipaddress>, Client Hostname=<ipaddress>

2016-09-23 10:34:35,740 DEBUG [javax.faces.webapp.UIComponentTag] Entered encodeBegin for client-Id: headContents

2016-09-23 10:34:35,740 DEBUG [javax.faces.webapp.UIComponentTag] Exited encodeBegin

2016-09-23 10:34:35,759 DEBUG [javax.faces.webapp.UIComponentTag] Entered encodeEnd for client-Id: headContents

2016-09-23 10:34:35,762 DEBUG [javax.faces.webapp.UIComponentTag] Exited encodeEnd for client-Id: headContents

 

Modified <jboss>/server/default/conf/jboss-log4j.xml:

 

   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">

                <param name="Threshold" value="INFO"/>

 

Saved and waited for more than 60 seconds, then logged in again. Server.log:

 

2016-09-23 10:38:35,514 INFO  [com.ca.ppm.event.impl.LoginEvent] Executing event: LoginEvent

2016-09-23 10:38:35,549 INFO  [com.ca.ppm.event.impl.LoginEvent] User superadmin attempted to login. Status=succeeded, Client IP=<ipaddress>, Client Hostname=<ipaddress>

 

No DEBUG entries.

 

As an additional check, I modified <jboss>/server/default/conf/jboss-log4j.xml back to TRACE:

 

   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">

                <param name="Threshold" value="TRACE"/>

 

Saved and waited for more than 60 seconds, then logged in again. Server.log:

 

2016-09-23 10:44:16,454 INFO  [com.ca.ppm.event.impl.LoginEvent] Executing event: LoginEvent

2016-09-23 10:44:16,487 INFO  [com.ca.ppm.event.impl.LoginEvent] User superadmin attempted to login. Status=succeeded, Client IP=<ipaddress>, Client Hostname=<ipaddress>

2016-09-23 10:44:17,345 DEBUG [javax.faces.webapp.UIComponentTag] Entered encodeBegin for client-Id: headContents

2016-09-23 10:44:17,345 DEBUG [javax.faces.webapp.UIComponentTag] Exited encodeBegin

2016-09-23 10:44:17,346 DEBUG [javax.faces.webapp.UIComponentTag] Entered encodeEnd for client-Id: headContents

2016-09-23 10:44:17,346 DEBUG [javax.faces.webapp.UIComponentTag] Exited encodeEnd for client-Id: headContents

 

DEBUG messages back.

 

So, it does indeed seem that we do not need to restart jboss to turn debug logging on and off, or to be more precise pickup any changes made to <jboss>/server/default/conf/jboss-log4j.xml.

 

I have not tested how this impacts changes to (I suspect it has no impact):

 

<jboss>\server\default\deploy\mail-service.xml

<jboss>\server\default\deploy\IdentityMinder.ear\config\com\netegrity\config\log4j_jboss.properties

 

Should be handy for debugging problems on production systems.

Outcomes