13.4.3. Configuring a Logging Profile using the CLI

A logging profile can be configured with log handlers, categories and a root logger using almost exactly the same syntax as when using the main logging subsystem.
There are only two differences between configuring the main logging subsystem and the logging profile:
  1. The root configuration path is /subsystem=logging/logging-profile=NAME
  2. A logging profile cannot contain other logging profiles.
Refer to the appropriate logging management task:

Example 13.58. Creating and Configuring a Logging Profile

Creating a logging profile and adding a category and file log handler.
  1. Create the profile:
    /subsystem=logging/logging-profile=accounts-app-profile:add
  2. Create file handler
    /subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:add(file={path=>"ejb-trace.log", "relative-to"=>"jboss.server.log.dir"})
    /subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:change-log-level(level="DEBUG")
  3. Create logger category
    /subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add(level=TRACE)
  4. Assign file handler to category
    /subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:assign-handler(name="ejb-trace-file")