Show Table of Contents
14.5.5. ロギングプロファイル設定の例
この例は、ロギングプロファイルの設定とそれを使用するアプリケーションを表しています。CLI セッション、生成された XML 設定、およびアプリケーションの
MANIFEST.MF ファイルを示します。
ロギングプロファイルの例には以下が指定されています。
- 名前は
accounts-app-profileです。 - ログカテゴリーは
com.company.accounts.ejbsです。 - ログレベルは
TRACEです。 - ログハンドラーはファイル
ejb-trace.logを使用するファイルハンドラーです。
例14.60 CLI セッション
localhost:bin user$ ./jboss-cli.sh -c
[standalone@localhost:9999 /] /subsystem=logging/logging-profile=accounts-app-profile:add
{"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:add(file={path=>"ejb-trace.log", "relative-to"=>"jboss.server.log.dir"})
{"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:write-attribute(name="level", value="DEBUG")
{"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add(level=TRACE)
{"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add-handler(name="ejb-trace-file")
{"outcome" => "success"}
[standalone@localhost:9999 /]例14.61 XML 設定
<logging-profiles>
<logging-profile name="accounts-app-profile">
<file-handler name="ejb-trace-file">
<level name="DEBUG"/>
<file relative-to="jboss.server.log.dir" path="ejb-trace.log"/>
</file-handler>
<logger category="com.company.accounts.ejbs">
<level name="TRACE"/>
<handlers>
<handler name="ejb-trace-file"/>
</handlers>
</logger>
</logging-profile>
</logging-profiles>例14.62 アプリケーションの MANIFEST.MF ファイル
Manifest-Version: 1.0 Logging-Profile: accounts-app-profile

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.