vCenter

 View Only
  • 1.  Log Levels – LOG4J Jboss log files

    Posted Apr 10, 2008 02:35 AM
    We have a JBoss based system that we intend to monitor with Hyperic.

    When setting alerts on log files entries we discovered that the available log levels don’t include the ‘TRACE’ level.
    Unfortunately for us some error messages are logged from this system using the TRACE level (not a very good practice but that is the way this system was implemented).

    Looking at HQ source code I found that ‘Log4JLogTrackPlugin’ class defines log levels as follows:

    private static final String[] LOG_LEVELS = {
    "FATAL,ERROR", //Error
    "WARN", //Warning
    "INFO", //Info
    "DEBUG" //Debug
    };

    public String[] getLogLevelAliases() {
    return LOG_LEVELS;
    }

    What would be the quickest way to enable us including log events with ‘TRACE’ level? (Edit the above, build and use the modified jar?)

    Any suggestions will be greatly appreciated.


  • 2.  RE: Log Levels – LOG4J Jboss log files

    Posted Apr 10, 2008 11:31 PM
    Probably, or redirect your log4j appenders to a target that can be parsed out of the box. Note adding a 5th element to that array looks like it will get you an illegalargumentexception from the superclass. Do it as "DEBUG, TRACE" the same way fatal and error are grouped together.


  • 3.  RE: Log Levels – LOG4J Jboss log files

    Posted Apr 11, 2008 04:32 AM
    Thanks for the reply.
    I changed my source (as suggested) built and deployed the hq-product.jar to the corresponding agent and it worked.
    I assume this can be raised as a defect, so new versions of HQ will be able to alert on TRACE output.

    Cheers,

    Avi


  • 4.  RE: Log Levels – LOG4J Jboss log files

    Posted Apr 11, 2008 02:20 PM
    http://jira.hyperic.com

    File a ticket, por favor.


  • 5.  RE: Log Levels – LOG4J Jboss log files

    Broadcom Employee
    Posted Apr 23, 2008 04:25 AM
    Hmm, I was about to check in a fix to include the TRACE level as debug.. but if there happens to be anyone currently monitoring at DEBUG they may start getting flooded with otherwise unwanted TRACE messages. I think that may have been why TRACE was left out in the first place, normally just used for developer/debugging, not so much for release? The plugin just uses a substring to filter based on the level, so if you could just get the string DEBUG into all the trace messages you'd be set ;) We could also have a plugin property or agent.properties for this, just not sure about flipping it on by default. Open to suggestions here.


  • 6.  RE: Log Levels – LOG4J Jboss log files

    Posted Apr 23, 2008 06:38 PM
    I'd vote for plugin property, then a user can map the l4j levels to the 4 levels recognized by hyperic in any way they choose. e.g., for a development/demo/beta type of instance you may want it to look like:

    String[] LOG_LEVELS = {
    "FATAL,ERROR", //Error
    "WARN,INFO", //Warning
    "DEBUG", //Info
    "TRACE" //Debug
    };