VMware vSphere

 View Only
  • 1.  Log tracking for custom application logs not using log4j format

    Posted Nov 25, 2010 03:19 AM
    Hi, per http://support.hyperic.com/display/DOC/Log+Tracking, Hyperic only supports log tracking for log files using log4j format.

    It should be possible to create a custom plugin that works similarly for non-log4j-format log files, correct?

    Are there any examples of such a custom plugin for log monitoring? I checked hyperforge and didn't find any there.

    thx,
    Chris


  • 2.  RE: Log tracking for custom application logs not using log4j format

    Posted Nov 25, 2010 04:16 AM
    Chris,

    It's not limited to log4j format only. You can also track Windows log events and Network Service logs by log level and regex filters. Those are explained in that same documentation section.

    --jeremy


  • 3.  RE: Log tracking for custom application logs not using log4j format

    Posted Nov 25, 2010 04:51 AM
    Thanks Jeremy, I saw that, but the logs I'm interested in monitoring are not windows event logs or network service logs. They're plain ol' application logs, just not in log4j format.

    Should be possible, right? Any known examples?

    thx,
    Chris


  • 4.  RE: Log tracking for custom application logs not using log4j format

    Posted Nov 26, 2010 03:29 AM
    I gotcha. I found this response elsewhere, and it may help you:

    "Setup a FileServer File service to monitor the log. Navigate to the Platform that is running the app, click the Tools Menu, and click Add Platform Service. From there you'll be able to name the Service and configure which file it should watch."

    Message was edited by: jeremy


  • 5.  RE: Log tracking for custom application logs not using log4j format

    Posted Nov 26, 2010 02:52 PM
    Hi,

    Actually I am also looking for this functionality and I cannot get this to work.
    I have a log file here: /home/hyperic/test.log

    The log files contains one line per entry. I would like to be able to have events generated in Hyperic HQ based on entry lines that are found to have a regular expression match. Simple no? But not possible unless you are using log4j. Please prove me wrong with complete step-by-step instructions + screenshots.

    PC


  • 6.  RE: Log tracking for custom application logs not using log4j format

    Posted Nov 26, 2010 03:56 PM
    hi again,

    It seems like the only way to get this to work is by configuring an alert for the log file being watched. The other problem with this is that it will _not_ trigger an alert/event unless the log file is modified again and again. This is particularly problematic when you have a custom application that continuously writes to a single opened output stream file.

    I have also noticed that there seems to be a minimum of 5 minutes before the log file can be re-examiner. I haven't found where to modify this.


  • 7.  RE: Log tracking for custom application logs not using log4j format

    Posted Nov 26, 2010 09:31 PM
    I looked at the source code for Log4JLogTrackPlugin.java and the class hierarchy it's derived from (LogTrackPlugin -> LogFileTailPlugin -> Log4JLogTrackPlugin) and it looks trivial to create a custom class that extends LogFileTailPlugin that works the same except doesn't look for or care about log4j log levels. All that's required is to override the supportsLogLevels() method of LogTrackPlugin to return "false" instead of "true". With that change, every log line will be processed and it won't try to find a log level.

    At this point I'm just investigating Hyperic and other monitoring frameworks, otherwise I'd go ahead and write this trivial class and add it to hyperforge for use by others. PC333, perhaps you can do this since you need it too?

    You can see the source code for the above classes on the web at http://svn.hyperic.org/trunk/src/org/hyperic/hq/product/?root=Hyperic+HQ .

    Chris


  • 8.  RE: Log tracking for custom application logs not using log4j format

    Posted Nov 29, 2010 10:12 AM
    Hi ctoomey2,

    Thanks for your reply. In fact, I am a C programmer, not a Java or Groovy programmer. I am as well, like you, investigating various monitoring tools available on the market. I'm going to have a hard time convincing my superiors to use Hyperic, with all the poor documentation available, the many inconsistencies and missing features. Now testing Enterprise Edition and it doesn't look much better. That's too bad!