ロギングは、通常の CM サーバーと CM API ユーザーの操作、および、CM サーバーまたは CM API ベースのアプリケーションの実行中に発生したエラーを追跡します。ログの入力は、コンピュータのデフォルト ロケールで、あるいは、コンピュータのロケールがサポートされない場合は米国英語で行われます。
デフォルトで、CM サーバーのロギングは INFO レベルに設定されています。ご使用の CM API ベースのアプリケーションでロギングを使用可能にするには、INFO レベルに設定する必要があります。
CM API、WebSphere® Application Server、および TSlogger のロギング パッケージを構成できます。
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 レベルで使用可能に設定してください。
############################################################ # 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 項目がアンコメントされている場合は、CMTracer[#].log という名前のトレース出力ファイル) が生成されます。それぞれのファイルはログイン ユーザーの HOME ディレクトリ ([#] にはファイルのローテーション番号が指定されます) にあります。それぞれのファイルがいっぱいになると別のファイルに出力されます。
上記の logging.properties 項目の使用では、ログ レコードは該当するファイルの最後に付加され、それぞれの項目が単純なフォーマットで保管されるように指定されています。logging.properties ファイルが変更されると、約 10 秒以内に自動的に通知され、CM API ベースのアプリケーションによって認識されます。アプリケーションを停止したり再始動したりする必要はありません。
ログ出力ファイルがいっぱい (40 MB) になると、新規ファイルが作成され、前のファイルはファイルのローテーションが行われた日付とタイム スタンプを含む名前に変更されます。 各ファイルは 40 MB のデータを保持し、既存の項目に新規項目が追加されます。これは、アプリケーションの再始動の間も行われます。ログ ファイルの数が 40 個に達すると、新規ファイルへのローテーションにより一番古いファイルが自動的に削除されます。
Java ロギングの構成方法について詳しくは、JDK java.util.logging.Logger と java.util.logging.FileHandler Javadoc を参照してください。
java -Djava.util.logging.config.file=C:¥myLogPropsFile.properties your_client_java_program_that_uses_CM-API
http://<server-name>:<admin-console-port-number>/ibm/consoleここで <server-name> は CM サーバー システムの名前で、<admin-console-port> は管理コンソールのポート番号 (CM サーバーではデフォルトで 12060、その他の WebSphere Application Server のバージョンでは 9060) です。
CM サーバー システムで使用している Websphere Application Server のタイプによっては、リアルタイムに変更を加えることができ、CM サーバーを停止および再始動する必要がありません。ほとんどの管理コンソールのロギングのセットアップ ページには、[構成] タブと [ランタイム] タブの、2 つのタブがあります。
管理コンソールから [トラブルシューティング]->[ロギングおよび追跡] をクリックし、サーバーのリストから構成するサーバーを選択します。[ログの詳細レベルの変更] を選択し、[ランタイム] タブをクリックします。[ランタイム] タブに加えられた変更は、その変更を保存するとすぐに有効になります。[構成] タブに加えられた変更は、サーバーを再始動するまで有効になりません。変更を永続させたいなら、[ランタイムの変更を構成にも保存する] チェック ボックスを選択します。 [コンポーネント (Components)] リンクを選択します。 ボックス中に *=info がリストされていることに留意してください。 com.ibm.rational.* オプションを開いて、com.ibm.rational.stp.* を選択します。 [メッセージおよび追跡レベル] オプションをクリックして、レベルを選択します。[OK] をクリックして、開かれるページの上部にある [メッセージ] 領域にある [保存] リンクをクリックします。サーバーを再始動しなくても、変更は有効になります。
CM サーバー システム上の Websphere Application Server のバージョンまたはクラスに、リアルタイムの構成変更を使用可能にする [ランタイム] タブがない場合は [構成] タブを使用し、次にサーバーを再始動して保管された変更点を有効にします。
tslogger.properties ファイルには、実行可能な変更および設定可能な許容値の範囲などのラベルが付けられた領域があります。デフォルトでは、INFO レベルのロギングが有効になっています。 INFO、WARNING、および SEVERE メッセージは、すべてログ ファイル中に記録されます。ログ ファイルを構成するには、tslogger.properties ファイルを編集しますが、このファイルはインストール時に適切に構成されており、変更する必要はありません。
tslogger.properties ファイルのデフォルト設定は、変更を必要としない値に設定されています。出力ファイルがいっぱいになると、ファイルのローテーションが行われ、次のファイルに出力されます。 ローテーション可能な最大ファイル数に達すると、最も古いファイルが削除され、ローテーションを行う次のファイルの場所が確保されます。