ユーザーのアプリケーションを実行するサーバーのレベルに応じて、 ランタイム・メッセージ・ロギングに次の表にまとめるようなさまざまなロギング・メカニズムを使用します。
デプロイメント環境 | 環境 | ロギング・サポート |
---|---|---|
WebSphere® Application Server V6.0 以降 | JRE 1.4.2 以上。WAS には CBE ロギング・サポートが組み込まれています | 共通ベース・イベント・ロギング |
IBM i WebFacing アプリケーションをアプリケーション・サーバーで実行すると、デフォルトで アプリケーション・サーバーのコンソールにロギング情報が送信されます。 WebSphere Application Server V6.0 のロギングおよびトレースについて詳しくは、 http://publib.boulder.ibm.com/infocenter/wsdoc400/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/ttrb_addtrace.html を参照してください。
WebSphere Application Server V6.0 の管理コンソールを使用して、WebFacing アプリケーション・ロガーのロギング・レベルを構成できます (com.ibm.etools.iseries.webfacing.context_root_name)。 ロガーの構成については、http://publib.boulder.ibm.com/infocenter/wsdoc400/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/ttrb_configjavalog.html を参照してください。
さらに、webfacinglogging.properties 構成ファイルを使用することで、 ロガーの詳細レベルと、WebFacing アプリケーション・ロガーの各種設定も構成できます。
デフォルトでは、WebSphere Application Server V6.0 のログ・メッセージはアプリケーション・サーバーのコンソールに書き込まれ、 ログ・レコードは WebSphere Application Server V6.0 の activity.log ファイルに書き込まれます。アプリケーション・サーバーの管理コンソールからトレースをオンにした場合、 トレース情報はアプリケーション・サーバー・インスタンスの trace.log ファイルに書き込まれます。 トレースが有効であるときに、すべてのログ・メッセージは単純テキスト形式で trace.log に記録され、 ログ・レベル CONFIG 以上のすべてのログ・レコードも 共通ベース・イベント形式で activity.log に記録されます。WebSphere Application Server V6.0 でのトレースのオンについては、 http://publib.boulder.ibm.com/infocenter/wsdoc400/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/ttrb_entrss.html を参照してください。
また、ランタイム・ロギングおよびトレース情報を、ご使用のアプリケーション・サーバーが稼働しているシステム内で個別のファイルに分けるように、 WebFacing アプリケーションの設定値を構成できます。ログ・レベルが CONFIG 以上の場合、 このロガーのトレースが有効であれば、ログ・レコードはログ・ファイルとトレース・ファイルに書き込まれます。 ログ・レベルが CONFIG よりも低い場合、トレース・レコードはトレース・ファイルに書き込まれます。 この機能を有効にするためのプロパティーについては、 下記のWebFacing アプリケーションの構成設定セクションを参照してください。
ログおよびトレース・ファイルは、 HTTP セッション別に編成されます。ログ・ファイルの名前は sessionid.log となります。 ここでの sessionid は、 WebFacing アプリケーションにアクセスするブラウザーのセッション ID です。同様に、トレース・ファイル名は sessionid.trace になります。WebFacing アプリケーションに関連するログ・ファイルは、 WebFacing アプリケーションを含む Web プロジェクトのコンテキスト・ルート名と同じ名前のディレクトリーに書き込まれます。 ユーザーの WebFacing ログおよびトレース・ファイルの場所の構成については、 以下のWebFacing アプリケーションの構成設定セクションにある logFileLocation プロパティーを参照してください。
ログ・レコードのメッセージ・テキストを参照するだけでよい場合は、 ログ・レコードを単純なストリングとしてフォーマットして書き込むように設定値を構成できます。共通ベース・イベント・ログ・レコードの形式の制御については、 以下のWebFacing アプリケーションの構成設定セクションにある useXMLFormatForCBELogging プロパティーを参照してください。
WebFacing アプリケーションのロギングおよびトレース設定値は、 webfacinglogging.properties ファイルによって構成できます。このファイルは、WebFacing Web プロジェクトの WebContent/WEB-INF/classes にあります。 以下に、このファイル内の設定値を示します。
# Control the level of runtime logging # The levels in descending order are: # SEVERE (highest value) # WARNING # INFO # CONFIG # FINE # FINER # FINEST (lowest value) # In addition, there is a level OFF that can be used to turn off logging, # and a level ALL that can be used to enable logging/tracing of all messages. # See the Java™ document for the java.util.logging class for more information. # The levels above or equal to CONFIG are considered logging. # The levels below CONFIG are considered tracing. # Default is SEVERE. com.ibm.etools.iseries.webfacing.level=SEVERE # Control if the logging level set in this file will override # the static configuration settings of log detail levels in WAS6.0 # This setting is only valid when running on WAS6.0 or later. # Please refer to the following page for setting log detail levels # in WAS6.0 Administrative Console: # http://publib.boulder.ibm.com/infocenter/wsdoc400/index.jsp?topic # =/com.ibm.websphere.iseries.doc/info/ae/ae/ttrb_configjavalog.html # Valid values are: # true - default # false com.ibm.etools.iseries.webfacing.overrideAdminLevelSetting=true # Control which directory the log and trace files will be written to. # A subdirectory with the same name as the web-app # will be created to store all the log and trace files of a specific web application. # This value will be used when property "logToFile" is set to true. # "%WASTraceDir" - trace directory of the WAS server instance. # By default, it is the SERVER_LOG_ROOT variable defined. # in the WAS server. This value will be used as default value # if the web application is running in a WAS environment. # If this value is not available, "%h/iserieslogs" will be used as # default. # "%h" - the value of the "user.home" system property # "%h/iserieslogs" will be used as default value # "%t" - the value of the system temporary directory # "." - the value of web-app/WEB-INF directory # "/" the local pathname separator com.ibm.etools.iseries.webfacing.logFileLocation=%WASTraceDir # Control if log and trace information will be written to files. # Valid values are: # true # false - default -- In this case the information is written to the console. com.ibm.etools.iseries.webfacing.logToFile=false # Control if parent's output handler of this logger will also be used. # This setting is only valid when running on WAS6.0 or later. # If this property is set to false, the log or tracing information will # not be written to the WAS 6.0 activity.log or trace.log # Valid values are: # true - default # false com.ibm.etools.iseries.webfacing.useParentHandler=true # Control the format of the Java log records written to a file. # This property is valid for WAS 5.1.x running on JDK1.4.2, # where java.util.logging classes are available. # If this property is set to true, the log records written to the # log file will be in XML format. # See the Java document for the java.util.logging.XMLFormatter class # for more information. # If this property is set to false, the log records written to the # log file will be in simple string format. # Valid values are: # true - default # false # it is only valid in the environment running on top of JDK1.4, # but don't have build in CommonBaseEvent support com.ibm.etools.iseries.webfacing.useXMLFormatForJSR47Logging=true # Control the format in which Common Base Event log records are written to a file. # This property is valid for WAS 6.0, which has built-in # Common Base Event Java logging support. # If this property is set to true, the log records written to the # log file will be in Common Base Event # XML format. You can us the Log and Trace Analyzer shipped in WDSC to view them. # See the help for Log and Trace Analyzer in WDSC for more information. # If this property is set to false, the log records written to the log # file will be in simple string format. # Valid values are: # true - default # false com.ibm.etools.iseries.webfacing.useXMLFormatForCBELogging=true #Control how many log files will be created for each web application # before the oldest log file is deleted. com.ibm.etools.iseries.maxlog=3