[jboss-jira] [JBoss JIRA] (AS7-4964) log message omitted from log when $ in class name
David Lloyd (JIRA)
jira-events at lists.jboss.org
Thu Jun 7 17:00:18 EDT 2012
[ https://issues.jboss.org/browse/AS7-4964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699958#comment-12699958 ]
David Lloyd commented on AS7-4964:
----------------------------------
The class name is not the same as a category name. You *can* get a logger with a category name that matches your class name but it is not recommended (since this causes log categories to not be resilient to refactoring). You can also force the class name to appear in the log but this doesn't change what the category is (i.e. you cannot configure the log level for just one class; it has to be done per category). Also, it's worth noting that putting class, file, or method name or line number in the log adds a performance overhead so you don't want to do it unless you're debugging, or your log volume is configured to be very low.
> log message omitted from log when $ in class name
> -------------------------------------------------
>
> Key: AS7-4964
> URL: https://issues.jboss.org/browse/AS7-4964
> Project: Application Server 7
> Issue Type: Bug
> Components: Logging
> Affects Versions: 7.1.1.Final
> Reporter: Kelly Dolan
> Assignee: James Perkins
>
> <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} %-5p [%C] %m%n"/>
> </formatter>
> <target name="System.out"/>
> </console-handler>
> <periodic-rotating-file-handler name="SERVER" autoflush="true">
> <level name="INFO"/>
> <formatter>
> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%C] %m%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="APPLICATION" autoflush="true">
> <level name="INFO"/>
> <formatter>
> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%C] %m%n"/>
> </formatter>
> <file relative-to="jboss.server.log.dir" path="application.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="jacorb">
> <level name="WARN"/>
> </logger>
> <logger category="jacorb.config">
> <level name="ERROR"/>
> </logger>
> <logger category="my.company">
> <level name="INFO"/>
> <handlers>
> <handler name="APPLICATION"/>
> </handlers>
> </logger>
> <logger category="org.jboss.as.server.deployment">
> <level name="INFO"/>
> <handlers>
> <handler name="CONSOLE"/>
> </handlers>
> </logger>
> <root-logger>
> <level name="WARN"/>
> <handlers>
> <handler name="SERVER"/>
> </handlers>
> </root-logger>
> </subsystem>
> With this, I expect
> a) all WARN messages to log in server.log
> b) all INFO messages for my.company classes to log in server.log and application.log
> c) all INFO messages for org.jboss.as.server.deployment to log in server.log and on the console
> (a) and (b) appear to work fine. (c) not so much.
> I see "INFO [org.jboss.as.server.deployment.AbstractDeploymentUnitService] JBAS015876: Starting deployment of "myapp.ear"" in both server.log and on the console.
> I do NOT see "INFO [org.jboss.as.server.deployment.DeploymentHandlerUtil$1] JBAS018559: Deployed "myapp.ear"" in either server.log and on the console.
> The only thing I can see that is weird about the one not being included in the log is that the message is logged w/in an inner class. Ultimately, my goal is to change <logger category="org.jboss.as.server.deployment"> to <logger category="org.jboss.as.server.deployment.DeploymentHandlerUtil$1"> as I only want to log JBoss WARN messages w/ the exception of the "Deployed" message.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list