Generic Log Adapter는 어댑터에서 생성된 Common Base Event 오브젝트를 로깅 에이전트로 송신될 수 있도록 하는 출력기 클래스를 제공합니다. 로그 및 추적 분석기를 사용하여 로깅 에이전트에 접속하고 응용프로그램 로그를 실시간으로 모니터 및 분석할 수 있습니다.
전제조건:모니터링에 대해 어댑터를 구성하려면 다음 단계를 수행하십시오.
참고: 새 어댑터 구성 파일을 작성하면 기본적으로 CBELogOutputter 클래스를 사용하도록
구성됩니다. 이 설정을 변경하지 않은 경우 이 프로시저를 건너뛸 수 있습니다.
어댑터 구성 파일의 출력기 컴포넌트는 Common Base Event 오브젝트를 로깅 에이전트에 쓰는
CBELogOutputter 클래스를 사용하도록 갱신되어야 합니다. 기존 출력기 컴포넌트를 갱신하거나 새
출력기 컴포넌트를 추가할 수 있습니다.
새 출력기 컴포넌트를 추가하려면 다음을 수행하십시오.
이름: | 컨텍스트에서 출력기의 이름. (예: 로깅 에이전트 출력기 |
설명: | 이 출력기가 수행하는 작업의 설명 |
실행 파일 클래스: | org.eclipse.hyades.logging.adapter.outputters.CBELogOutputter |
로깅 레벨: | 출력기 컴포넌트가 사용해야 하는 내부 로깅의 레벨. 이 레벨은 CommonBaseEvent 심각도 값을 기초로 합니다. 숫자가 높을수록 메시지의 심각도가 높아집니다. 로깅 레벨에 대해 지정된 숫자는 출력기 컴포넌트가 해당 심각도 이상의 내부 출력기 메시지만 로깅하도록 합니다. 71 이상의 값은 출력기가 모든 내부 출력기 메시지를 로그하지 않음을 의미합니다. 0(영)값은 출력기가 모든 심각도의 내부 출력기 메시지를 로그하는 것을 의미합니다. 권장 값은 50으로, 중요하거나 심각한 내부 출력기 오류 메시지만 로그하는 것을 의미합니다. |
역할: | 출력기 |
고유 ID: | 3단계에서 컨텍스트 인스턴스에 정의된 출력기를 지정해야 합니다. 찾아보기 단추를 사용하여 올바른 ID를 선택하십시오. |
로그 구문 분석기로 로그 파일을 지속적으로 모니터하려면 연속 조작에 대해 어댑터 구성 파일의 컨텍스트 인스턴스 특성을 갱신해야 합니다.
사용자가 작성한 로그 어댑터는 Windows 환경에서 일괄처리 파일을 통해 외부적으로
실행되거나 비Windows 환경에서 쉘 스크립트를 통해 실행될 수 있습니다. 다음은 로그 어댑터를 실행할
Java 프로세스를 시작하는 데 사용될 수 있는 샘플 파일입니다.
참고: Generic Log Adapter로 작성한 로깅 에이전트를 접속하고 모니터하려면,
Generic Log Adapter가 실행될 시스템에 Agent Controller를 설치하고 Generic Log Adapter가 시작되기
전에 이를 시작해야 합니다.
Windows 일괄처리 파일:
@rem USAGE: runregex @rem PURPOSE: Illustrates the functional capabilities of the Generic Log Adapter (GLA) run-time using an example adapter file and sample log file. @rem INSTRUCTIONS: When executing in a GLA run-time environment, change the value of the %GLA_HOME% environment variable to the absolute path of the unzipped GLA run-time. @rem NOTE: When executing in a plug-in (e.g. Eclipse) run-time environment, create a temporary working directory and change the value of the %GLA_HOME% environment variable to the @rem absolute path of the new temporary working directory. Furthermore, create a %GLA_HOME%\config directory and copy the contents of the org.eclipse.hyades.logging.adapter.config @rem plug-in to the new %GLA_HOME%\config directory. Finally, create a %GLA_HOME%\lib directory and copy the following JAR files to the new %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 MY_DIRECTORY=MyAdapter SET CONFIG_FILE=%GLA_HOME%\config\%MY_DIRECTORY%\myadapter.adapter PUSHD %GLA_HOME%\config\%MY_DIRECTORY%\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%" POPD비Windows 일괄처리 파일:
#!/bin/sh # USAGE: runregex_example.sh # PURPOSE: Illustrates the functional capabilities of the Generic Log Adapter (GLA) run-time using an example adapter file and sample log file. # INSTRUCTIONS: When executing in a GLA run-time environment, change the value of the $GLA_HOME environment variable to the absolute path of the unzipped GLA run-time. # NOTE: When executing in a plug-in (e.g. Eclipse) run-time environment, create a temporary working directory and change the value of the $GLA_HOME environment variable to the # absolute path of the new temporary working directory. Furthermore, create a $GLA_HOME/config directory and copy the contents of the com.ibm.etools.logging.adapter.config # plug-in to the new $GLA_HOME/config directory. Finally, create a $GLA_HOME/lib directory and copy the following JAR files to the new $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 YOUR_DIRECTORY=MY_DIRECTORY export MY_DIRECTORY CONFIG_FILE="$GLA_HOME/config/$MY_DIRECTORY/myadapter.adapter" export CONFIG_FILE CUR_DIR=`pwd` export CUR_DIR cd "$GLA_HOME/config/$MY_DIRECTORY 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 프로세스를 실행하는 데 필요한 파일을 구성하십시오.
활성 응용프로그램 로그를 모니터할 준비가 되었습니다.
관련 개념
Hyades 일반 로그 어댑터 개요
Common Base Event 형식 스펙
관련 타스크
로그 구문 분석기 작성
관련 참조
어댑터 구성 파일 구조
어댑터 구성 편집기
정규 표현식 문법
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.