-
1. Re: Logging in different files for specified packages with AS 7
wdfink Apr 22, 2012 2:15 PM (in response to haukegulich)1 of 1 people found this helpfulEdit standalone.xml subsystem == <subsystem xmlns="urn:jboss:domain:logging:1.1">
Search the "<periodic-rotating-file-handler name="FILE"> and copy the whole element, rename the handler-name and the file's path.
Add a new <logger category="de.hauke.server.jms" use-parent-handlers="false"> and add only the handler section with your handler (name that you give ...).
You must add use-parent-handlers because the default is that all handlers of root-logger are added.
This should work.
-
2. Re: Logging in different files for specified packages with AS 7
haukegulich Apr 22, 2012 3:21 PM (in response to wdfink)Thank you very much. That helped. Now I have the jms.log with the jms logging.
What I now need is to exclude this category from the console appender.
But first step works!
Thanks again :-)
-
3. Re: Logging in different files for specified packages with AS 7
wdfink Apr 23, 2012 3:01 AM (in response to haukegulich)If you set use-parent-handlers="false" and add only the new FILE handler, as described above, it should not log to console (if you still not change other elements of the logging configuration.
-
4. Re: Logging in different files for specified packages with AS 7
haukegulich Apr 23, 2012 3:55 AM (in response to wdfink)Here is my complete standalone xml part containing the logging
{code:xml}
<subsystem xmlns="urn:jboss:domain:logging:1.1">
<console-handler name="CONSOLE" autoflush="true">
<level name="INFO"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-8p [%-35.35c] | %s%E%n"/>
</formatter>
</console-handler>
<periodic-rotating-file-handler name="FILE" autoflush="true">
<level name="INFO"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-8p [%-35.35c] | %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<periodic-rotating-file-handler name="JMSLogging" autoflush="true">
<level name="INFO"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-8p [%-35.35c] | %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="jms.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.apache.tomcat.util.modeler">
<level name="WARN"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<logger category="de.hauke.server.jms" use-parent-handlers="false">
<level name="DEBUG"/>
<handlers>
<handler name="JMSLogging"/>
</handlers>
</logger>
<root-logger>
<level name="INFO"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
</subsystem>{code}
Sorry that the file isn't formatted, but the formatting is always lost in this forum.
The stange thing is, if I put
use-parent-handlers="false"
behind <logger category="de.hauke...." use-parent-handlers="false">, after starting JBoss, this attribute is gone. Seems to be at the wrong position?
Thanks,
Hauke
-
5. Re: Logging in different files for specified packages with AS 7
wdfink Apr 23, 2012 5:08 AM (in response to haukegulich)For me it works with "logging:1.1".
I've tested with AS7.1.1.Final.
What version do you use, maybe it is a resolved bug ....
-
6. Re: Logging in different files for specified packages with AS 7
haukegulich Apr 23, 2012 5:11 AM (in response to wdfink)I am working with AS 7.0.2
I will try tonight with 7.1.1.Final.
Hopefully my application sill works with 7.1.1 :-)