Application specific (per-deplyoment) logging AS6 final and correct reference to Logger
pi4630 Nov 9, 2011 9:13 AMHi,
I've applied the changes to my logmanager-jboss-beans.xml as described here. My application log file is created, but it's empty.
When I remove the 'mode="On Demand" as suggested here, I get the following error
{noformat}
ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "OnDemandJBossLogManagerContextSelectorService" is missing the following dependencies:
Dependency "JBossLogManagerClassLoaderContextSelectorService" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'JBossLogManagerClassLoaderContextSelectorService' **")
DEPLOYMENTS IN ERROR:
Deployment "JBossLogManagerClassLoaderContextSelectorService" is in error due to the following reason(s): ** NOT FOUND Depends on 'JBossLogManagerClassLoaderContextSelectorService' **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
{noformat}
The application specific jboss-logging.xml is inside META-INF folder of my application, which is deployed as JAR. The file looks like this:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!-- My application jboss-logging.xml -->
<logging xmlns="urn:jboss:logging:6.0" context="Mercurius">
<!-- ~ This element, in conjunction with the "context" attribute above,
tells the ~ logging system that I want my own separate logging environment. -->
<define-context name="Mercurius" />
<!-- Just an example handler. -->
<file-handler file-name="/home/pb26683/Pippo.log" name="FILE"
autoflush="true" append="true">
<formatter>
<pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n" />
</formatter>
<properties>
<property name="encoding">UTF-8</property>
</properties>
</file-handler>
<!-- Configure the root logger with my handler from above -->
<root-logger>
<level name="INFO" />
<handlers>
<handler-ref name="FILE" />
</handlers>
</root-logger>
</logging>{code}
Why is "JBossLogManagerClassLoaderContextSelectorService" the state "not found"?
A more general question: from my SLSB, I refer to the org.jboss.logging.Logger this way:
{code}import org.jboss.logging.Logger;
Logger log = Logger.getLogger(this.getClass());{code}
Should it be referenced by annotation instead?