汎用ログ・アダプターには、アダプターで生成された共通ベース・イベント・オブジェクトをロギング・エージェントに送ることができるアウトプッター・クラスが用意されています。 ログおよびトレース・アナライザーを使用すると、ロギング・エージェントへの接続、モニター、 およびアプリケーション・ログのリアルタイムでの分析を行うことができます。
前提条件:以下のステップに従って、モニター用のアダプターを構成します。
注: 新しいアダプター構成ファイルを作成すると、
デフォルトでは CBELogOutputter クラスを使用するように構成されます。
この設定を変更していない場合は、この手順をスキップしてください。
共通ベース・イベント・オブジェクトをロギング・エージェントに書き込む CBELogOutputter クラスを使用するように、
アダプター構成ファイル内のアウトプッター・コンポーネントを更新する必要があります。
既存のアウトプッター・コンポーネントを更新する方法と、新しいアウトプッター・コンポーネントを追加する方法があります。
新しいアウトプッター・コンポーネントを追加するには、以下のステップに従います。
名前: | コンテキストにおけるアウトプッターの名前 |
説明: | このアウトプッターが実行する内容の説明 |
実行可能クラス: | org.eclipse.hyades.logging.adapter.outputters.CBELogOutputter |
ロギング・レベル: | アウトプッター・コンポーネントが使用する内部ロギングのレベル。
値 99 は、アウトプッターがメッセージをログに記録しないことを意味します。 値 0 は、アウトプッターがすべての重大度のメッセージをログに記録することを意味します。 推奨値は 50 です。この値は、「重大」または「致命的」の内部アウトプッター・ エラー・メッセージがログに記録されることを意味します。 |
役割: | アウトプッター |
固有の ID: | ステップ 3 の「コンテキスト・インスタンス」に 定義したアウトプッターを指していなければなりません。「参照」ボタンを使用して正しい ID を選択します。 |
ログ・パーサーによってログ・ファイルを連続モニターする場合は、アダプター構成ファイルの コンテキスト・インスタンス・プロパティーを連続稼働に更新する必要があります。
作成したログ・アダプターは、Windows 環境ではバッチ・ファイルから、
または Windows 以外の環境ではシェル・スクリプトから外部で実行することができます。
以下に、ログ・アダプターを実行する Java プロセスを起動する場合に役立つサンプル・ファイルを示します。
注: 汎用ログ・アダプターによって作成されたロギング・エージェントを接続して
モニターするには、汎用ログ・アダプターを実行するシステムに Hyades Agent Controller をインストールし、
汎用ログ・アダプターを開始する前に開始する必要があります。
Windows バッチ・ファイル
@rem USAGE: runregex @rem PURPOSE: Illustrates the functional capabilities of the Generic Log Adapter (GLA) @rem run-time using an example adapter file and sample log file. @rem ASSUMPTIONS: This batch file assumes the GLA run-time and required files are @rem stored in the following directory structure: @rem %GLA_HOME%¥config - GLA adapter configuration files @rem %GLA_HOME%¥lib - GLA run-time and required jars @rem %GLA_HOME%¥schema - GLA adapter configuration schema files @rem INSTRUCTIONS: @rem If the GLA run-time and required files are stored as indicated in the @rem assumptions section above, change the value of the %GLA_HOME% @rem environment variable to the absolute path where the GLA run-time @rem and required files are stored. @rem If the GLA run-time files are stored in a plug-in (e.g. Eclipse) @rem environment, perform the following instructions: @rem 1) Create a temporary directory to store the GLA run-time and required files. @rem 2) Create the config, lib, and schema directories in the temporary @rem directory creatd in step 1) @rem 3) Change the value of the %GLA_HOME% environment variable to the @rem absolute path of the temporary directory created in step 1) @rem 4) Copy the adapter files you want to run into the %GLA_HOME%¥config directory. @rem For example if you want to run the Apache adapter files then copy the @rem Apache directory of the org.eclipse.hyades.logging.adapter.config @rem plug-in and all of its contents to the %GLA_HOME%¥config directory. @rem 5) Copy the contents of the schema directory of @rem org.eclipse.hyades.logging.adapter plug-in to the %GLA_HOME%¥schema directory. @rem 6) Copy the following jar files to the %GLA_HOME%¥lib directory @rem Plug-in | JAR @rem --------------------------------------------------- @rem org.eclipse.hyades.logging.adapter | hgla.jar @rem org.eclipse.hyades.logging.core | hlcbe101.jar @rem org.eclipse.hyades.logging.core | hlcore.jar @rem org.eclipse.hyades.execution.remote | hexr.jar @rem org.eclipse.emf.ecore | ecore.jar @rem org.eclipse.emf.common | common.jar SET GLA_HOME=d:¥GenericLogAdapter SET CONFIG_FILE=%GLA_HOME%¥config¥my.adapter @PUSHD %GLA_HOME%¥config¥ java -DGLA_HOME="%GLA_HOME%" -classpath "%GLA_HOME%¥lib¥hgla.jar;%GLA_HOME%¥lib¥hexr.jar;%GLA_HOME%¥lib¥hlcbe101.jar;%GLA_HOME%¥lib¥ecore.jar;%GLA_HOME%¥lib¥common.jar;%GLA_HOME%¥lib¥hlcore.jar" org.eclipse.hyades.logging.adapter.Adapter -ac "%CONFIG_FILE%" -cc "%CONFIG_FILE%" POPDWindows 以外のバッチ・ファイル
#!/bin/sh # USAGE: runregex.sh # PURPOSE: Illustrates the functional capabilities of the Generic Log Adapter (GLA) # run-time using an example adapter file and sample log file. # ASSUMPTIONS: This shell file assumes the GLA run-time and required files are # stored in the following directory structure: # %GLA_HOME%/config - GLA adapter configuration files # %GLA_HOME%/lib - GLA run-time and required jars # %GLA_HOME%/schema - GLA adapter configuration schema files # INSTRUCTIONS: # If the GLA run-time and required files are stored as indicated in the # assumptions section above, change the value of the %GLA_HOME% # environment variable to the absolute path where the GLA run-time # and required files are stored. # If the GLA run-time files are stored in a plug-in (e.g. Eclipse) # environment, perform the following instructions: # 1) Create a temporary directory to store the GLA run-time and required files. # 2) Create the config, lib, and schema directories in the temporary # directory creatd in step 1) # 3) Change the value of the %GLA_HOME% environment variable to the # absolute path of the temporary directory created in step 1) # 4) Copy the adapter files you want to run to the %GLA_HOME%/config directory. # For example, if you want to run the Apache adapter files then copy the # Apache directory of the org.eclipse.hyades.logging.adapter.config # plug-in and all of its contents to the %GLA_HOME%/config directory. # 5) Copy the contents of the schema directory of # org.eclipse.hyades.logging.adapter plug-in to the %GLA_HOME%/schema directory. # 6) Copy the following jar files to the %GLA_HOME%/lib directory # Plug-in | JAR # --------------------------------------------------- # org.eclipse.hyades.logging.adapter | hgla.jar # org.eclipse.hyades.logging.core | hlcbe101.jar # org.eclipse.hyades.logging.core | hlcore.jar # org.eclipse.hyades.execution.remote | hexr.jar # org.eclipse.emf.ecore | ecore.jar # org.eclipse.emf.common | common.jar GLA_HOME=/home/eclipse/GenericLogAdapter export GLA_HOME CONFIG_FILE="$GLA_HOME/config/my.adapter" export CONFIG_FILE CUR_DIR=`pwd` export CUR_DIR cd "$GLA_HOME/config" java -DGLA_HOME="$GLA_HOME" -classpath "$GLA_HOME/lib/hgla.jar:$GLA_HOME/lib/hexr.jar:$GLA_HOME/lib/hlcbe101.jar:$GLA_HOME/lib/ecore.jar:$GLA_HOME/lib/common.jar:$GLA_HOME/lib/hlcore.jar" org.eclipse.hyades.logging.adapter.Adapter -ac "$CONFIG_FILE" -cc "$CONFIG_FILE" cd "$CUR_DIR"必要に応じて、アダプターを実行する Java プロセスを起動するファイルを構成します。
ライブ・アプリケーション・ログをモニターできるようになりました。
関連概念
汎用ログ・アダプターの概説
共通ベース・イベント・フォーマットの仕様
関連タスク
ログ・パーサーの作成
関連参照
アダプター構成ファイルの構造
アダプター構成エディター
正規表現グラマー
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.