François Charoy wrote:
> 
> You are true but the Log4j initialisation is done when jboss is started. So
> I'm not sure that the property file would be useful.
> I tried to use the Log4jService but I have never been able to start the
> service. With this service you can configure the place of your
> log4j.properties file and changes are checked periodically. I uncomment the
> lines in jboss.conf but it did not change anything. Thus I tried to start it
> manually but I got a preRegister exception and that's all...
> 


Yes, I am successfully using log4j.

I have a simple configuration using just JBOSS with a
standalone client application.  My JBOSS version is a fairly
recent one built from CVS.  The log4j integration was not in
2.1 but should be in 2.2.

I am using the JBOSS configuration named "default".

So, my "...dist/conf/default/jboss.conf" file has the
following lines:

<!-- Logging services. Typically you should enable the the
ConsoleLogging &
        FileLogging mbeans or the Log4jService. Both can be
enabled if desired
        but the Log4jService can perform the ConsoleLogging
& FileLogging
        services in additional to that offered by the log4j
package. -->

<-- MLET CODE = "org.jboss.logging.ConsoleLogging"
ARCHIVE="jboss.jar" CODEBASE="../../lib/ext/">
   <-- ARG TYPE="java.lang.String"
VALUE="Information,Warning,Error">
   <-- ARG TYPE="java.lang.String" VALUE="[{2}] {4}">
<-- /MLET>
<-- MLET CODE = "org.jboss.logging.FileLogging"
ARCHIVE="jboss.jar" CODEBASE="../../lib/ext/">
   <-- ARG TYPE="java.lang.String"
VALUE="Information,Debug,Warning,Error">
   <-- ARG TYPE="java.lang.String" VALUE="[{2}] {4}">
<-- /MLET>

<!-- Uncomment to use the log4j based logging service and
with the log4j.properties.
        When this service is used the ConsoleLogging &
FileLogging should be disabled.
 -->
<MLET CODE = "org.jboss.logging.Log4jService"
ARCHIVE="jboss.jar,log4j.jar" CODEBASE="../../lib/ext/">
</MLET>


The first block part of the block above comments out the
default logging facility.  The latter part of the block
above enables the log4j facility.

I put my "log4j.properties" file in ".../dist/conf/default"
and it is picked up nicely when JBOSS is started.  I haven't
tried to edit the log4j.properties while the server is
running to see if the changes are picked up automatically or
not though.



-- 
Aaron Metzger

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to