로깅 구성

로깅은 CM 서버 및 CM API 기반 애플리케이션을 모니터링하고 디버깅하기 위해 사용할 수 있습니다.

로깅은 일반적인 CM 서버 및 CM API 사용자 작업뿐만 아니라 CM 서버 또는 CM API 기반 애플리케이션이 실행 중인 동안 발생하는 모든 오류를 추적합니다. 시스템의 로케일이 지원되지 않는 경우에 로그는 시스템의 기본 로케일 또는 미국 영어로 입력됩니다.

기본적으로 CM 서버의 로깅은 INFO 레벨로 설정됩니다. CM API 기반 애플리케이션의 로깅을 INFO 레벨로 사용해야 합니다.

CM API, WebSphere® Application Server 및 TSlogger 로깅을 구성할 수 있습니다.

CM API 로깅

CM API 로깅은 애플리케이션을 실행하기 위해 사용 중인 JRE의 JDK 디렉토리 구조에 있는 logging.properties 파일을 사용하여 제어됩니다. JDK의 jre\lib 디렉토리(예제: C:\Program Files\IBM\WebSphere\AST\eclipse\jre\lib, C:\jdk_5.0\jre\lib, 또는 C:\Program Files\Java\jre1.5.0_06\lib)에서 logging.properties 파일을 찾아보십시오.

로깅은 기본적으로 사용 불가능합니다. 이를 INFO 레벨에서 사용해야 합니다.

다음 예제 logging.properties 파일에는 CM API 기반 애플리케이션의 로그 및 추적 설정을 구성하는 방법을 보여주는 항목이 들어 있습니다.
############################################################
#      Global properties
############################################################
#
# "handlers" specifies a comma separated list of log Handler 
# classes.  These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers = java.util.logging.ConsoleHandler

# To also add the FileHandler, use the following line instead.
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers.  For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
# The next line enables logging (for all logger objects) to occur at the INFO level
.level=INFO

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# CMLogger - Should always be enabled at the INFO level. 
#
# Applications using CM API do not have to be stopped and restarted; changes to the configured

# logging.properties file are automatically noticed and honored within 10 seconds.
#
# The following lines designate logging for the CMLogger object to occur at the INFO level,
# and that the log output file will be named CMLogger[#].log, located in the logged-in
# user's HOME directory; the log output file will rotate through 40 files, each file being
# limited to 40000000 bytes.  Log entries will be appended to the current log output
# file in the rotation and will be written using a simple format.
#
com.ibm.rational.stp.common.internal.util.CMLogger.level = INFO
com.ibm.rational.stp.common.internal.util.LogHandler.pattern = %h/CMLogger%g.log
com.ibm.rational.stp.common.internal.util.LogHandler.limit = 40000000
com.ibm.rational.stp.common.internal.util.LogHandler.count = 40
com.ibm.rational.stp.common.internal.util.LogHandler.append = true
com.ibm.rational.stp.common.internal.util.LogHandler.formatter = java.util.logging.SimpleFormatter

# CMTracer - Enable (uncomment) the entries below for temporary use only, as tracing
# can be resource intensive.  
#
# Applications using CM API do not have to be stopped and restarted; changes to the configured
# logging.properties file are automatically noticed and honored within 10 seconds.
#
# The following lines designate tracing for the CMTracer object to occur at the FINER level,
# and that the trace output file will be named CMTracer[#].log, located in the logged-in
# user's HOME directory; the trace output file will rotate through 40 files, each file being
# limited to 40000000 bytes.  Trace entries will be appended to the current trace output
# file in the rotation and will be written using a simple format.
#
#com.ibm.rational.stp.common.internal.util.CMTracer.level = FINER
#com.ibm.rational.stp.common.internal.util.TraceHandler.pattern = %h/CMTracer%g.log
#com.ibm.rational.stp.common.internal.util.TraceHandler.limit = 40000000
#com.ibm.rational.stp.common.internal.util.TraceHandler.count = 40
#com.ibm.rational.stp.common.internal.util.TraceHandler.append = true
#com.ibm.rational.stp.common.internal.util.TraceHandler.formatter = java.util.logging.SimpleFormatter

이러한 설정 결과 CMLogger[#].log 로그 파일(및 CMTracer[#].log 출력 파일 CMTracer 항목이 주석 해제될 때)이 생깁니다. 각 파일은 로그인된 사용자의 HOME 디렉토리에 있습니다. 여기서 [#]는 파일 회전 번호를 표시합니다. 각 파일이 가득 차게 되면 출력은 파일에서 파일로 이동합니다.

위의 logging.properties 항목을 사용하면 로그 레코드가 적용 가능한 파일의 끝에 추가되어야 함을 지정하는 것이며 각 항목은 단순 형식으로 저장됩니다. logging.properties 파일의 변경 사항은 CM API 기반 애플리케이션에 의해 대략 10초 내에 통지됩니다. 애플리케이션을 중지한 후 다시 시작할 필요가 없습니다.

로그 출력 파일이 가득 차게 되면(40MB) 새 파일이 작성되고 이전 파일은 파일 회전이 발생할 때 날짜와 시간소인을 포함하도록 이름이 바뀝니다. 각 파일은 40MB의 데이터를 보유하고 교차 애플리케이션 다시 시작을 포함하여 새 항목은 기존 항목에 추가됩니다. 로그 파일 수가 40이 되면 새 파일의 회전으로 인해 이전 파일이 자동으로 삭제됩니다.

Java 로깅을 구성하는 방법에 대한 자세한 내용은 JDK java.util.logging.Logger 및 java.util.logging.FileHandler Javadoc를 참조하십시오.

사용자 정의 로깅 특성 파일을 작성하는 경우, -D 인수를 지정하여 JVM에 대해 찾는 위치를 지정해야 합니다. 예를 들어, 다음과 같습니다.
java -Djava.util.logging.config.file=C:\myLogPropsFile.properties your_client_java_program_that_uses_CM-API

WebSphere Application Server 로깅 및 추적 구성

WebSphere Application Server 관리 콘솔을 사용하여 WebSphere Application Server 로깅 및 추적을 설정하고 구성합니다. 이 URL을 사용하여 WebSphere Application Server 관리 콘솔에 액세스할 수 있습니다.
http://<server-name>:<admin-console-port-number>/ibm/console
여기서 <server-name>은(는) CM 서버 시스템의 이름이고, <admin-console-port>은(는) 관리 콘솔 포트 번호(CM 서버의 경우 기본적으로 12060 또는 다른 WebSphere Application Server 버전의 경우 9060)입니다.
주: WebSphere Application Server (CM 서버 컴포넌트 포함)에서 실행 중인 컴포넌트에 대한 모든 레벨(FINE, FINER 또는 FINEST)에서 추적은 성능면에서 부정적인 영향을 주게 됩니다.

CM 서버 시스템에 사용 중인 Websphere Application Server의 유형에 따라 CM 서버를 중지한 후 다시 시작할 필요 없이 실시간으로 변경할 수 있습니다. 대부분의 관리 콘솔 로깅 설정 페이지에는 구성 탭과 런타임 탭의 두 개의 탭이 있습니다.

관리 콘솔에서 문제점 해결->로깅 및 추적을 클릭하고 서버 목록에서 구성할 서버를 선택하십시오. 로그 세부사항 레벨 변경을 선택하고 런타임 탭을 클릭하십시오. 런타임 탭의 변경 사항은 변경 사항을 저장하는 즉시 적용됩니다. 구성 탭 변경 사항은 서버를 다시 시작하기 전에는 적용되지 않습니다. 변경 사항을 지속하고 싶은 경우에는 런타임 변경사항도 구성에 저장 선택란을 선택하십시오. 컴포넌트 링크를 선택하십시오. *=info가 상자에 나열되어 있음을 유의하십시오. com.ibm.rational.* 옵션을 열고 com.ibm.rational.stp.*를 선택하십시오. 메시지 및 추적 레벨 옵션을 클릭하여 레벨을 선택하십시오. 확인 단추를 클릭한 후 나타나는 페이지의 맨 위에 있는 메시지 영역에서 저장 링크를 클릭하십시오. 서버를 다시 시작하지 않고도 변경사항이 적용됩니다.

CM 서버 시스템에서 Websphere Application Server의 버전 또는 클래스가 실시간 구성 변경을 가능하게 해주는 실시간 탭을 제공하지 않는 경우에는 구성 탭을 사용한 다음 서버를 다시 시작하여 저장된 변경사항을 적용하십시오.

로그 파일 크기와 회전할 로그 파일 수의 기본 설정을 늘려야 합니다. 회전할 로그 파일 수를 40 이상으로 설정하고 로그 파일 크기를 40MB 이상으로 설정해야 합니다. Websphere Application Server 관리 콘솔에서 JVM 로그 파일 크기 및 파일 회전 설정을 변경하려면 다음 단계를 수행하십시오.
  1. 문제점 해결->로깅 및 추적을 선택하십시오.
  2. 서버 목록에서 구성할 관련 서버를 선택하십시오.
  3. JVM 로그를 선택한 후 구성 탭을 클릭하십시오(런타임 탭은 현재 SystemOut.log 및 SystemErr.log 파일 내용을 보는 데 사용할 수 있습니다).
  4. SystemOut 및 SystemErr 위치, 파일 크기(적어도 40MB여야 함)와 유지보수할 히스토리 파일 수(적어도 40이여야 함)에 대한 변경사항을 작성하십시오.
  5. 확인 단추를 클릭한 후 나타나는 페이지의 맨 위에 있는 메시지 영역에서 저장 링크를 클릭하십시오.
WebSphere Application Server 로그 파일은 다음 위치에 있습니다.
  • UNIX® : /opt/IBM/RationalSDLC/common/CM/profiles/cmprofile/logs/server1/
  • Linux®: /opt/ibm/RationalSDLC/common/CM/profiles/cmprofile/logs/server1/
  • Windows®: \Program Files\IBM\RationalSDLC\common\CM\profiles\cmprofile\logs\server1\

TSlogger

TSLogger는 백엔드 ONCRPC 서버 프로세스를 로깅하기 위한 것입니다. 다음에 위치한 tslogger.properties 파일을 편집하여 이 유틸리티를 구성합니다.
  • Windows: \Program Files\IBM\RationalSDLC\common\CM\bin\tslogger.properties
  • UNIX: /opt/IBM/RationalSDLC/common/CM/bin/tslogger.properties
  • Linux: /opt/ibm/RationalSDLC/common/CM/bin/tslogger.properties
로그 및 추적 파일은 다음 위치에 있습니다.
  • Windows: \Program Files\IBM\RationalSDLC\common\CM\logs\server1\ccrpc [and \cqrpc]
  • UNIX: /opt/IBM/RationalSDLC/common/CM/logs/server1/ccrpc [and /cqrpc]
  • Linux: /opt/ibm/RationalSDLC/common/CM/logs/server1/ccrpc [and /cqrpc]
로그 및 추적 파일에는 다음이 포함됩니다.
  • SystemOut.log - 일반 로그 출력이며 기본적으로 INFO 레벨에서 로깅합니다.
  • SystemErr.log - 오류/예외 출력, 기본적으로 사용됩니다.
  • trace.log - 추적 출력, 기본적으로 사용 불가능합니다.

tslogger.properties 파일에는 변경할 수 있는 영역과 허용되는 값 범위에 대한 레이블이 있습니다. INFO 레벨에서 기본적으로 로깅이 사용됩니다. 모든 INFO, WARNING 및 SEVERE 메시지가 로그 파일에 기록됩니다. 로그 파일은 tslogger.properties 파일을 편집하여 구성되지만 파일이 설치 시 제대로 구성되었고 변경이 필요하지 않습니다.

tslogger.properties 파일의 기본 설정은 수정이 필요하지 않는 값으로 설정됩니다. 출력 파일이 가득 차면 출력이 다음 파일로 회전됩니다. 회전할 최대 파일 수에 도달하면 가장 오래된 파일이 제거되어 회전할 다음 파일을 위한 공간을 만듭니다.

최상위 레벨부터 최하위 레벨까지의 로깅 레벨에 대한 요약입니다.
  • OFF: 모든 로깅 및 추적 사용 불가능.
  • ERROR: JSR47의 SEVERE에 해당.
  • WARNING: JSR47의 WARNING에 해당.
  • INFO: JSR47의 INFO에 해당.
  • DEBUG_MIN: JSR47의 FINE에 해당.
  • DEBUG_MID: JSR47의 FINER에 해당.
  • DEBUG_MAX: JSR47의 FINEST에 해당.
  • ALL: 모든 레벨의 로깅 및 추적 사용.
관련 개념
ClearQuest 로그 파일 및 로그 특성 파일

피드백