Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
12.5. Logging Profiles
12.5.1. About Logging Profiles Link kopierenLink in die Zwischenablage kopiert!
Important
- A unique name. This is required.
- Any number of log handlers.
- Any number of log categories.
- Up to one root logger.
MANIFEST.MF file, using the logging-profile attribute.
12.5.2. Create a new Logging Profile using the CLI Link kopierenLink in die Zwischenablage kopiert!
/subsystem=logging/logging-profile=NAME:add
/subsystem=logging/logging-profile=NAME:add
12.5.3. Configuring a Logging Profile using the CLI Link kopierenLink in die Zwischenablage kopiert!
- The root configuration path is
/subsystem=logging/logging-profile=NAME - A logging profile cannot contain other logging profiles.
Example 12.79. Creating and Configuring a Logging Profile
- Create the profile:
/subsystem=logging/logging-profile=accounts-app-profile:add
/subsystem=logging/logging-profile=accounts-app-profile:addCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 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:add(file={path=>"ejb-trace.log", "relative-to"=>"jboss.server.log.dir"})Copy to Clipboard Copied! Toggle word wrap Toggle overflow /subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:write-attribute(name="level", value="DEBUG")
/subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:write-attribute(name="level", value="DEBUG")Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create logger category
/subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add(level=TRACE)
/subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add(level=TRACE)Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Assign file handler to category
/subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add-handler(name="ejb-trace-file")
/subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add-handler(name="ejb-trace-file")Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.5.4. Specify a Logging Profile in an Application Link kopierenLink in die Zwischenablage kopiert!
MANIFEST.MF file.
Prerequisites:
- You must know the name of the logging profile that has been setup on the server for this application to use. Ask your server administrator for the name of the profile to use.
Procedure 12.9. Add Logging Profile configuration to an Application
Edit
MANIFEST.MFIf your application does not have aMANIFEST.MFfile: create one with the following content, replacing NAME with the required profile name.Manifest-Version: 1.0 Logging-Profile: NAME
Manifest-Version: 1.0 Logging-Profile: NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow If your application already has aMANIFEST.MFfile: add the following line to it, replacing NAME with the required profile name.Logging-Profile: NAME
Logging-Profile: NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow
Note
maven-war-plugin, you can put your MANIFEST.MF file in src/main/resources/META-INF/ and add the following configuration to your pom.xml file.
12.5.5. Example Logging Profile Configuration Link kopierenLink in die Zwischenablage kopiert!
MANIFEST.MF file of the application.
- The Name is
accounts-app-profile. - The Log Category is
com.company.accounts.ejbs. - The Log level
TRACE. - The Log handler is a file handler using the file
ejb-trace.log.
Example 12.80. CLI session
Example 12.81. XML Configuration
Example 12.82. Application MANIFEST.MF file
Manifest-Version: 1.0 Logging-Profile: accounts-app-profile
Manifest-Version: 1.0
Logging-Profile: accounts-app-profile