Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Eclipse Test & Performance Tools Platform, Part 2: Monitor applications

Collect and analyze a variety of log files

Martin Streicher (martin.streicher@linux-mag.com), Editor in Chief, Linux Magazine
Martin Streicher is the Editor-in-Chief of Linux Magazine. Martin earned a Master of Science in Computer Science from Purdue University and has been programming UNIX-like systems since 1986 in the Pascal, C, Perl, Java, and (most recently) Ruby programming languages.

Summary:  In this "Eclipse Test & Performance Tools Platform" tutorial series, learn how to use the capabilities of the Eclipse Test & Performance Tools Platform (TPTP) to convert application log files into a structured format. Then, using TPTP and other specialized tools designed to process and analyze log files, you can quickly discern usage patterns, performance profiles, and errors.

View more content in this series

Date:  25 Apr 2006
Level:  Intermediate PDF:  A4 and Letter (423 KB | 39 pages)Get Adobe® Reader®

Activity:  19818 views
Comments:  

The formatter and organizing the outputter

Now that the parser has yielded properties and values, the new data must be assembled into a CBE instance. That's the role of the formatter.

Emit CBE XML records to a file

The adapter formatter requires no configuration. It's an internal operation that creates CBE objects that conform to the CBE V1.0.1 specification.

After the formatter has created CBE objects, it's the job of the outputter to emit them to a file, standard output, another log, a logging agent, or a log analyzer. If your adapter configuration defines multiple contexts, you can use a special formatter to allow multiple contexts to write to a single file.

To keep things simple, emit the CBE XML records to a single file:

  1. Click Outputter in the Generic Log Adapter perspective, then choose SingleFileOutputter for Outputter type.
  2. Right-click Outputter, then click Add > property.
  3. Click the new property, then set Property name to directory. Set the Property value to a directory to which you're able to write files. Omit the name of a file. Just specify the path of the directory, omitting the trailing slash.
  4. Right-click Outputter again and click Add > property. Set this new Property name to fileName, and set the Property value to a file name. This file will be created in the directory named by directory.

Change the context instance

In addition to changing the configuration, you must also change the context instance to use the proper outputter class. To do so, complete these steps:

  1. Expand Contexts in the General Log Adapter perspective and expand Context Basic Context Implementation.
  2. Click Component Logging Agent Outputter.
  3. Change the Name and Description to Single File Outputter.
  4. Change the Executable class to org.eclipse.hyades.logging.adapter.outputters.CBEFileOutputter.
  5. Save the configuration file.

Add the SingleFileOutputterType

There is one more important step: For some reason, the Adapter Configuration Editor can omit an important element from the outputter definition in the configuration file for the adapter. (You can read the relevant thread on the developerWorks Autonomic computing forum's No Output from Outputter.) However, you can quickly add the element to the file manually.

Using your favorite editor, open the file my.adapter. Scroll to the bottom of the file and look for the following text.


Listing 16. The CBE equivalent of the first record of daemon.log
                    
<cc:Outputter 
  description="Single File Outputter" 
  uniqueID="N13725210AFF11DA8000AE8373D52828" 
  type="SingleFileOutputter">
    <pu:Property propertyName="directory" 
      propertyValue="/home/mstreicher"/>
    <pu:Property propertyName="fileName" 
      propertyValue="emitter.log"/>
    <op:SingleFileOutputterType directory="/home/mstreicher" 
      fileName="emitter.log"/>
</cc:Outputter>

If the line <op:SingleFileOutputterType... /> is missing, add it, changing the values of attributes directory and fileName to match the values of the similarly names properties. Then save the file.

8 of 12 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source, Java technology
ArticleID=108958
TutorialTitle=Eclipse Test & Performance Tools Platform, Part 2: Monitor applications
publish-date=04252006
author1-email=martin.streicher@linux-mag.com
author1-email-cc=martin.streicher@linux-mag.com