此内容没有您所选择的语言版本。
12.3. Logging Configuration in the CLI
The Management CLI must be running and connected to the relevant JBoss EAP instance. For further information see Section 3.4.2, “Launch the Management CLI”
12.3.1. Configure the Root Logger with the CLI 复制链接链接已复制到粘贴板!
- Add log handlers to the root logger.
- Display the root logger configuration.
- Change the log level.
- Remove log handlers from the root logger.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a Log Handler to the Root Logger
- Use the
add-handler
operation with the following syntax where HANDLER is the name of the log handler to be added./subsystem=logging/root-logger=ROOT:add-handler(name="HANDLER")
/subsystem=logging/root-logger=ROOT:add-handler(name="HANDLER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The log handler must already have been created before it can be added to the root logger.Example 12.3. Root Logger add-handler operation
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:add-handler(name="FILE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:add-handler(name="FILE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display the Contents of the Root Logger Configuration
- Use the
read-resource
operation with the following syntax./subsystem=logging/root-logger=ROOT:read-resource
/subsystem=logging/root-logger=ROOT:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.4. Root Logger read-resource operation
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Log Level of the Root Logger
- Use the
write-attribute
operation with the following syntax where LEVEL is one of the supported log levels./subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="LEVEL")
/subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="LEVEL")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.5. Root Logger write-attribute operation to set the log level
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a Log Handler from the Root Logger
- Use the
remove-handler
with the following syntax, where HANDLER is the name of the log handler to be removed./subsystem=logging/root-logger=ROOT:remove-handler(name="HANDLER")
/subsystem=logging/root-logger=ROOT:remove-handler(name="HANDLER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.6. Remove a Log Handler
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:remove-handler(name="FILE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:remove-handler(name="FILE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.2. Configure a Log Category in the CLI 复制链接链接已复制到粘贴板!
- Add a new log category.
- Display the configuration of a log category.
- Set the log level.
- Add log handlers to a log category.
- Remove log handlers from a log category.
- Remove a log category.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a log category
- Use the
add
operation with the following syntax. Replace CATEGORY with the category to be added./subsystem=logging/logger=CATEGORY:add
/subsystem=logging/logger=CATEGORY:add
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.7. Adding a new log category
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:add {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:add {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display a log category configuration
- Use the
read-resource
operation with the following syntax. Replace CATEGORY with the name of the category./subsystem=logging/logger=CATEGORY:read-resource
/subsystem=logging/logger=CATEGORY:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.8. Log Category read-resource operation
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the log level
- Use the
write-attribute
operation with the following syntax. Replace CATEGORY with the name of the log category and LEVEL with the log level that is to be set./subsystem=logging/logger=CATEGORY:write-attribute(name="level", value="LEVEL")
/subsystem=logging/logger=CATEGORY:write-attribute(name="level", value="LEVEL")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.9. Setting a log level
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the log category to use the log handlers of the root logger.
- Use the
write-attribute
operation with the following syntax. Replace CATEGORY with the name of the log category. Replace BOOLEAN with true for this log category to use the handlers of the root logger. Replace it with false if it is to use only its own assigned handlers./subsystem=logging/logger=CATEGORY:write-attribute(name="use-parent-handlers", value="BOOLEAN")
/subsystem=logging/logger=CATEGORY:write-attribute(name="use-parent-handlers", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.10. Setting use-parent-handlers
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:write-attribute(name="use-parent-handlers", value="true") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:write-attribute(name="use-parent-handlers", value="true") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add a log handlers to a log category
- Use the
add-handler
operation with the following syntax. Replace CATEGORY with the name of the category and HANDLER with the name of the handler to be added./subsystem=logging/logger=CATEGORY:add-handler(name="HANDLER")
/subsystem=logging/logger=CATEGORY:add-handler(name="HANDLER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The log handler must already have been created before it can be added to the root logger.Example 12.11. Adding a log handler
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:add-handler(name="AccountsNFSAsync") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:add-handler(name="AccountsNFSAsync") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a log handler from a log category
- Use the
remove-handler
operation with the following syntax. Replace CATEGORY with the name of the category and HANDLER with the name of the log handler to be removed./subsystem=logging/logger=CATEGORY:remove-handler(name="HANDLER")
/subsystem=logging/logger=CATEGORY:remove-handler(name="HANDLER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.12. Removing a log handler
[standalone@localhost:9999 /] /subsystem=logging/logger=jacorb:remove-handler(name="AccountsNFSAsync") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logger=jacorb:remove-handler(name="AccountsNFSAsync") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a category
- Use the
remove
operation with the following syntax. Replace CATEGORY with the name of the category to be removed./subsystem=logging/logger=CATEGORY:remove
/subsystem=logging/logger=CATEGORY:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.13. Removing a log category
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/logger=com.company.accounts.rec:remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.3. Configure a Console Log Handler in the CLI 复制链接链接已复制到粘贴板!
- Add a new console log handler.
- Display the configuration of a console log handler.
- Set the handler's log level.
- Set the target for the handler's output.
- Set the encoding used for the handler's output.
- Set the formatter used for the handler's output.
- Set whether the handler uses autoflush or not.
- Remove a console log handler.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a Console Log Handler
- Use the
add
operation with the following syntax. Replace HANDLER with the console log handler to be added./subsystem=logging/console-handler=HANDLER:add
/subsystem=logging/console-handler=HANDLER:add
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.14. Add a Console Log Handler
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:add {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:add {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display a console log handler configuration
- Use the
read-resource
operation with the following syntax. Replace HANDLER with the name of the console log handler./subsystem=logging/console-handler=HANDLER:read-resource
/subsystem=logging/console-handler=HANDLER:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.15. Display a console log handler configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Log Level
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the console log handler and LEVEL with the log level that is to be set./subsystem=logging/console-handler=HANDLER:write-attribute(name="level", value="INFO")
/subsystem=logging/console-handler=HANDLER:write-attribute(name="level", value="INFO")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.16. Set the Log Level
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="level", value="TRACE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="level", value="TRACE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Target
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the console log handler. Replace TARGET with eitherSystem.err
orSystem.out
for the system error stream or standard out stream respectively./subsystem=logging/console-handler=HANDLER:write-attribute(name="target", value="TARGET")
/subsystem=logging/console-handler=HANDLER:write-attribute(name="target", value="TARGET")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.17. Set the Target
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="target", value="System.err") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="target", value="System.err") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Encoding
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the console log handler. Replace ENCODING with the name of the required character encoding system./subsystem=logging/console-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
/subsystem=logging/console-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.18. Set the Encoding
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Formatter
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the console log handler. Replace FORMAT with the required formatter string./subsystem=logging/console-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
/subsystem=logging/console-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.19. Set the Formatter
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Auto Flush
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the console log handler. Replace BOOLEAN withtrue
if this handler is to immediately write its output./subsystem=logging/console-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
/subsystem=logging/console-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.20. Set the Auto Flush
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="autoflush", value="true") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:write-attribute(name="autoflush", value="true") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a Console Log Handler
- Use the
remove
operation with the following syntax. Replace HANDLER with the name of the console log handler to be removed./subsystem=logging/console-handler=HANDLER:remove
/subsystem=logging/console-handler=HANDLER:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.21. Remove a Console Log Handler
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/console-handler=ERRORCONSOLE:remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.4. Configure a File Log Handler in the CLI 复制链接链接已复制到粘贴板!
- Add a new file log handler.
- Display the configuration of a file log handler
- Set the handler's log level.
- Set the handler's appending behavior.
- Set whether the handler uses autoflush or not.
- Set the encoding used for the handler's output.
- Specify the file to which the log handler will write.
- Set the formatter used for the handler's output.
- Remove a file log handler.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a file log handler
- Use the
add
operation with the following syntax. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable./subsystem=logging/file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"})
/subsystem=logging/file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.22. Add a file log handler
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:add(file={"path"=>"accounts.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:add(file={"path"=>"accounts.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display a file log handler configuration
- Use the
read-resource
operation with the following syntax. Replace HANDLER with the name of the file log handler./subsystem=logging/file-handler=HANDLER:read-resource
/subsystem=logging/file-handler=HANDLER:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.23. Using the read-resource operation
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Log level
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the file log handler. Replace LOG_LEVEL_VALUE with the log level that is to be set./subsystem=logging/file-handler=HANDLER:write-attribute(name="level", value="LOG_LEVEL_VALUE")
/subsystem=logging/file-handler=HANDLER:write-attribute(name="level", value="LOG_LEVEL_VALUE")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.24. Changing the log level
/subsystem=logging/file-handler=accounts_log:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
/subsystem=logging/file-handler=accounts_log:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the append behaviour
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the file log handler. Replace BOOLEAN with false if you required that a new log file be created each time the application server is launched. Replace BOOLEAN withtrue
if the application server should continue to use the same file./subsystem=logging/file-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
/subsystem=logging/file-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.25. Changing the append property
Copy to Clipboard Copied! Toggle word wrap Toggle overflow JBoss EAP 6 must be restarted for this change to take effect. - Set the Auto Flush
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the file log handler. Replace BOOLEAN withtrue
if this handler is to immediately write its output./subsystem=logging/file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
/subsystem=logging/file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.26. Changing the autoflush property
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="autoflush", value="false") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="autoflush", value="false") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Encoding
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the file log handler. Replace ENCODING with the name of the required character encoding system./subsystem=logging/file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
/subsystem=logging/file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.27. Set the Encoding
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Change the file to which the log handler writes
- Use the
write-attribute
operation with the following syntax. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable./subsystem=logging/file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
/subsystem=logging/file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.28. Change the file to which the log handler writes
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="file", value={"path"=>"accounts-debug.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="file", value={"path"=>"accounts-debug.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Formatter
- Use the
write-attribute
operation with the following syntax. Replace HANDLER with the name of the file log handler. Replace FORMAT with the required formatter string./subsystem=logging/file-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
/subsystem=logging/file-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.29. Set the Formatter
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a File Log Handler
- Use the
remove
operation with the following syntax. Replace HANDLER with the name of the file log handler to be removed./subsystem=logging/file-handler=HANDLER:remove
/subsystem=logging/file-handler=HANDLER:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.30. Remove a File Log Handler
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/file-handler=accounts_log:remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow A log handler can only be removed if it is not being referenced by a log category or an async log handler.
12.3.5. Configure a Periodic Log Handler in the CLI 复制链接链接已复制到粘贴板!
- Add a new periodic log handler.
- Display the configuration of a periodic log handler
- Set the handler's log level.
- Set the handler's appending behavior.
- Set whether or not the handler uses
autoflush
. - Set the encoding used for the handler's output.
- Specify the file to which the log handler will write.
- Set the formatter used for the handler's output.
- Set the suffix for rotated logs.
- Remove a periodic log handler.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a new Periodic Rotating File log handler
- Use the
add
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"}, suffix="SUFFIX")
/subsystem=logging/periodic-rotating-file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"}, suffix="SUFFIX")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable. Replace SUFFIX with the file rotation suffix to be used.Example 12.31. Add a new handler
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:add(file={"path"=>"daily-debug.log", "relative-to"=>"jboss.server.log.dir"}, suffix=".yyyy.MM.dd") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:add(file={"path"=>"daily-debug.log", "relative-to"=>"jboss.server.log.dir"}, suffix=".yyyy.MM.dd") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display a Periodic Rotating File log handler configuration
- Use the
read-resource
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:read-resource
/subsystem=logging/periodic-rotating-file-handler=HANDLER:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler.Example 12.32. Using the read-resource operation
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Log level
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="level". value="LOG_LEVEL_VALUE")
/subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="level". value="LOG_LEVEL_VALUE")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the periodic log handler. Replace LOG_LEVEL_VALUE with the log level that is to be set.Example 12.33. Set the log level
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="level", value="DEBUG") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the append behavior
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-rotating-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
/subsystem=logging/periodic-rotating-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the periodic log handler. Replace BOOLEAN withfalse
if you required that a new log file be created each time the application server is launched. Replace BOOLEAN withtrue
if the application server should continue to use the same file.JBoss EAP 6 must be restarted for this change to take effect.Example 12.34. Set the append behavior
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Auto Flush
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
/subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the periodic log handler. Replace BOOLEAN withtrue
if this handler is to immediately write its output.Example 12.35. Set the Auto Flush behavior
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="autoflush", value="false") { "outcome" => "success", "response-headers" => {"process-state" => "reload-required"} }
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="autoflush", value="false") { "outcome" => "success", "response-headers" => {"process-state" => "reload-required"} }
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Encoding
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
/subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the periodic log handler. Replace ENCODING with the name of the required character encoding system.Example 12.36. Set the Encoding
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Change the file to which the log handler writes
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
/subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the periodic log handler. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable.Example 12.37. Change the file to which the log handler writes
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="file", value={"path"=>"daily-debug.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="file", value={"path"=>"daily-debug.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Formatter
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
/subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the periodic log handler. Replace FORMAT with the required formatter string.Example 12.38. Set the Formatter
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the suffix for rotated logs
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="suffix", value="SUFFIX")
/subsystem=logging/periodic-rotating-file-handler=HANDLER:write-attribute(name="suffix", value="SUFFIX")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace SUFFIX with the required suffix string.Example 12.39. Set the suffix for rotated log
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="suffix", value=".yyyy-MM-dd-HH") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:write-attribute(name="suffix", value=".yyyy-MM-dd-HH") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a periodic log handler
- Use the
remove
operation with the following syntax./subsystem=logging/periodic-rotating-file-handler=HANDLER:remove
/subsystem=logging/periodic-rotating-file-handler=HANDLER:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the periodic log handler.Example 12.40. Remove a periodic log handler
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-rotating-file-handler=HOURLY_DEBUG:remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.6. Configure a Size Log Handler in the CLI 复制链接链接已复制到粘贴板!
- Add a new log handler.
- Display the configuration of the log handler.
- Set the handler's log level.
- Set the handler's appending behavior.
- Set whether the handler uses autoflush or not.
- Set the encoding used for the handler's output.
- Specify the file to which the log handler will write.
- Set the formatter used for the handler's output.
- Set the maximum size of each log file.
- Set the maximum number of backup logs to keep.
- Set the rotate on boot option for the size rotation file handler.
- Set the suffix for rotated logs.
- Remove a log handler.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a new log handler
- Use the
add
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"})
/subsystem=logging/size-rotating-file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable.Example 12.41. Add a new log handler
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:add(file={"path"=>"accounts_trace.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:add(file={"path"=>"accounts_trace.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display the configuration of the log handler
- Use the
read-resource
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:read-resource
/subsystem=logging/size-rotating-file-handler=HANDLER:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler.Example 12.42. Display the configuration of the log handler
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the handler's log level
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attributel(name="level", value="LOG_LEVEL_VALUE")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attributel(name="level", value="LOG_LEVEL_VALUE")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace LOG_LEVEL_VALUE with the log level that is to be set.Example 12.43. Set the handler's log level
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="level", value="TRACE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="level", value="TRACE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the handler's appending behavior
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace BOOLEAN withfalse
if you required that a new log file be created each time the application server is launched. Replace BOOLEAN withtrue
if the application server should continue to use the same file.JBoss EAP 6 must be restarted for this change to take effect.Example 12.44. Set the handler's appending behavior
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set whether the handler uses autoflush or not
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace BOOLEAN withtrue
if this handler is to immediately write its output.Example 12.45. Set whether the handler uses autoflush or not
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="autoflush", value="true") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="autoflush", value="true") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the encoding used for the handler's output
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace ENCODING with the name of the required character encoding system.Example 12.46. Set the encoding used for the handler's output
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Specify the file to which the log handler will write
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable.Example 12.47. Specify the file to which the log handler will write
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="file", value={"path"=>"accounts_trace.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="file", value={"path"=>"accounts_trace.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the formatter used for the handler's output
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="formatter", value="FORMATTER")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="formatter", value="FORMATTER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace FORMAT with the required formatter string.Example 12.48. Set the formatter used for the handler's output
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p (%c) [%t] %s%E%n") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p (%c) [%t] %s%E%n") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the maximum size of each log file
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="rotate-size", value="SIZE")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="rotate-size", value="SIZE")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace SIZE with maximum file size.Example 12.49. Set the maximum size of each log file
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="rotate-size", value="50m") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="rotate-size", value="50m") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the maximum number of backup logs to keep
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="max-backup-index", value="NUMBER")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="max-backup-index", value="NUMBER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace NUMBER with the required number of log files to keep.Example 12.50. Set the maximum number of backup logs to keep
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="max-backup-index", value="5") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="max-backup-index", value="5") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the rotate-on-boot option on the
size-rotating-file-handler
- This option is only available for the
size-rotating-file-handler
file handler. It defaults tofalse
, meaning a new log file is not created on server restart.To change it, use thewrite-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="rotate-on-boot", value="BOOLEAN")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="rotate-on-boot", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of thesize-rotating-file-handler
log handler. Replace BOOLEAN withtrue
if a newsize-rotating-file-handler
log file should be created on restart.Example 12.51. Specify to create a new
size-rotating-file-handler
log file on server restart[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="rotate-on-boot", value="true") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="rotate-on-boot", value="true") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the suffix for rotated logs
- Use the
write-attribute
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="suffix", value="SUFFIX")
/subsystem=logging/size-rotating-file-handler=HANDLER:write-attribute(name="suffix", value="SUFFIX")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace SUFFIX with the required suffix string.Example 12.52. Set the suffix for rotated logs
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="suffix", value=".yyyy-MM-dd-HH") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:write-attribute(name="suffix", value=".yyyy-MM-dd-HH") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a log handler
- Use the
remove
operation with the following syntax./subsystem=logging/size-rotating-file-handler=HANDLER:remove
/subsystem=logging/size-rotating-file-handler=HANDLER:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler.Example 12.53. Remove a log handler
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/size-rotating-file-handler=ACCOUNTS_TRACE:remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Add a new periodic size rotating handler.
- Display the configuration of a periodic size rotating handler.
- Set the handler's log level.
- Set the handler's appending behavior.
- Set whether or not the handler uses
autoflush
. - Set the encoding used for the handler's output.
- Specify the file to which the log handler will write.
- Set the formatter used for the handler's output.
- Set the maximum size of each log file.
- Set the maximum number of backup logs to keep.
- Set the rotate on boot option for the periodic size rotating handler.
- Set the suffix for rotated logs.
- Remove a periodic size rotating handler.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a new Periodic Size Rotating handler
- Use the
add
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"})
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:add(file={"path"=>"PATH", "relative-to"=>"DIR"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable.Example 12.54. Add a new log handler
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:add(file={"path"=>"periodic_size.log","relative-to"=>"jboss.server.log.dir"},suffix=".yyyy.MM.dd") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:add(file={"path"=>"periodic_size.log","relative-to"=>"jboss.server.log.dir"},suffix=".yyyy.MM.dd") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display the configuration of the log handler
- Use the
read-resource
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:read-resource
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler.Example 12.55. Display the configuration of the log handler
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the handler's log level
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="level", value="LOG_LEVEL_VALUE")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="level", value="LOG_LEVEL_VALUE")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace LOG_LEVEL_VALUE with the log level that is to be set.Example 12.56. Set the handler's log level
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="level", value="TRACE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="level", value="TRACE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the handler's appending behavior
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="append", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace BOOLEAN withfalse
if you required that a new log file be created each time the application server is launched. Replace BOOLEAN withtrue
if the application server should continue to use the same file.JBoss EAP 6 must be restarted for this change to take effect.Example 12.57. Set the handler's appending behavior
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set whether the handler uses autoflush or not
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="autoflush", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace BOOLEAN withtrue
if this handler is to immediately write its output.Example 12.58. Set whether the handler uses autoflush or not
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="autoflush", value="true") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="autoflush", value="true") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the encoding used for the handler's output
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="encoding", value="ENCODING")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace ENCODING with the name of the required character encoding system.Example 12.59. Set the encoding used for the handler's output
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="encoding", value="utf-8") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Specify the file to which the log handler will write
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="file", value={"path"=>"PATH", "relative-to"=>"DIR"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace PATH with the filename for the file that the log is being written to. Replace DIR with the name of the directory where the file is to be located. The value of DIR can be a path variable.Example 12.60. Specify the file to which the log handler will write
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="file", value={"path"=>"accounts_trace.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="file", value={"path"=>"accounts_trace.log", "relative-to"=>"jboss.server.log.dir"}) {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the formatter used for the handler's output
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="formatter", value="FORMAT")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace FORMAT with the required formatter string or name of the formatter as specified in the configuration file.Example 12.61. Set the formatter used for the handler's output
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p (%c) [%t] %s%E%n") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p (%c) [%t] %s%E%n") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the maximum size of each log file
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="rotate-size", value="SIZE")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="rotate-size", value="SIZE")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace SIZE with maximum file size.Example 12.62. Set the maximum size of each log file
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="rotate-size", value="50m") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="rotate-size", value="50m") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the maximum number of backup logs to keep
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="max-backup-index", value="NUMBER")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="max-backup-index", value="NUMBER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace NUMBER with the required number of log files to keep.Example 12.63. Set the maximum number of backup logs to keep
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="max-backup-index", value="5") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="max-backup-index", value="5") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the rotate-on-boot option on the
periodic-size-rotating-file-handler
- It defaults to
false
, meaning a new log file is not created on server restart.To change it, use thewrite-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="rotate-on-boot", value="BOOLEAN")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="rotate-on-boot", value="BOOLEAN")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of theperiodic-size-rotating-file-handler
log handler. Replace BOOLEAN withtrue
if a newperiodic-size-rotating-file-handler
log file should be created on restart.Example 12.64. Specify to create a new
periodic-size-rotating-file-handler
log file on server restart[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="rotate-on-boot", value="true") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="rotate-on-boot", value="true") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the suffix for rotated logs
- Use the
write-attribute
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="suffix", value="SUFFIX")
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:write-attribute(name="suffix", value="SUFFIX")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace SUFFIX with the required suffix string.Example 12.65. Set a suffix for rotated logs
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="suffix", value=".yyyy-MM-dd-HH") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:write-attribute(name="suffix", value=".yyyy-MM-dd-HH") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove a log handler
- Use the
remove
operation with the following syntax./subsystem=logging/periodic-size-rotating-file-handler=HANDLER:remove
/subsystem=logging/periodic-size-rotating-file-handler=HANDLER:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler.Example 12.66. Remove a log handler
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.8. Configure a Async Log Handler in the CLI 复制链接链接已复制到粘贴板!
- Add a new async log handler
- Display the configuration of an async log handler
- Change the log level
- Set the queue length
- Set the overflow action
- Add sub-handlers
- Remove sub-handlers
- Remove an async log handler
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a new async log handler
- Use the
add
operation with the following syntax./subsystem=logging/async-handler=HANDLER:add(queue-length="LENGTH")
/subsystem=logging/async-handler=HANDLER:add(queue-length="LENGTH")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace LENGTH with value of the maximum number of log requests that can be held in queue.Example 12.67. Add a new async log handler
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:add(queue-length="10") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:add(queue-length="10") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display the configuration of an async log handler
- Use the
read-resource
operation with the following syntax./subsystem=logging/async-handler=HANDLER:read-resource
/subsystem=logging/async-handler=HANDLER:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler.Example 12.68. Display the configuration of an async log handler
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Change the log level
- Use the
write-attribute
operation with the following syntax./subsystem=logging/async-handler=HANDLER:write-attribute(name="level", value="LOG_LEVEL_VALUE")
/subsystem=logging/async-handler=HANDLER:write-attribute(name="level", value="LOG_LEVEL_VALUE")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace LOG_LEVEL_VALUE with the log level that is to be set.Example 12.69. Change the log level
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:write-attribute(name="level", value="INFO") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:write-attribute(name="level", value="INFO") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the queue length
- Use the
write-attribute
operation with the following syntax./subsystem=logging/async-handler=HANDLER:write-attribute(name="queue-length", value="LENGTH")
/subsystem=logging/async-handler=HANDLER:write-attribute(name="queue-length", value="LENGTH")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace LENGTH with value of the maximum number of log requests that can be held in queue.JBoss EAP 6 must be restarted for this change to take effect.Example 12.70. Set the queue length
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the overflow action
- Use the
write-attribute
operation with the following syntax./subsystem=logging/async-handler=HANDLER:write-attribute(name="overflow-action", value="ACTION")
/subsystem=logging/async-handler=HANDLER:write-attribute(name="overflow-action", value="ACTION")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace ACTION with either DISCARD or BLOCK.Example 12.71. Set the overflow action
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:write-attribute(name="overflow-action", value="DISCARD") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:write-attribute(name="overflow-action", value="DISCARD") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add sub-handlers
- Use the
add-handler
operation with the following syntax./subsystem=logging/async-handler=HANDLER:add-handler(name="SUBHANDLER")
/subsystem=logging/async-handler=HANDLER:add-handler(name="SUBHANDLER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace SUBHANDLER with the name of the log handler that is to be added as a sub-handler of this async handler.Example 12.72. Add sub-handlers
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:add-handler(name="NFS_FILE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:add-handler(name="NFS_FILE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove sub-handlers
- Use the
remove-handler
operation with the following syntax./subsystem=logging/async-handler=HANDLER:remove-handler(name="SUBHANDLER")
/subsystem=logging/async-handler=HANDLER:remove-handler(name="SUBHANDLER")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler. Replace SUBHANDLER with the name of the sub-handler to remove.Example 12.73. Remove sub-handlers
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:remove-handler(name="NFS_FILE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:remove-handler(name="NFS_FILE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove an async log handler
- Use the
remove
operation with the following syntax./subsystem=logging/async-handler=HANDLER:remove
/subsystem=logging/async-handler=HANDLER:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace HANDLER with the name of the log handler.Example 12.74. Remove an async log handler
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.9. Configure a Custom Handler in the CLI 复制链接链接已复制到粘贴板!
- Add a new custom handler.
- Display the configuration of a custom handler.
- Set the log level.
- Remove a custom handler.
Important
/subsystem=logging/logging-profile=NAME/
instead of /subsystem=logging/
.
/subsystem=logging/
with /profile=NAME/subsystem=logging/
.
- Add a New Custom Handler
- Use the
add
operation with the following syntax./subsystem=logging/custom-handler="MyCustomHandler":add
/subsystem=logging/custom-handler="MyCustomHandler":add
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.75. Adding a new custom handler
[standalone@localhost:9999 /] /subsystem=logging/custom-handler="MyCustomHandler":add(class="JdbcLogger",module="com.MyModule",formatter="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n",properties={"maxNumberOfDays"=>"90","fileName"=>"custom.log","compressBackups"=>"true"})
[standalone@localhost:9999 /] /subsystem=logging/custom-handler="MyCustomHandler":add(class="JdbcLogger",module="com.MyModule",formatter="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n",properties={"maxNumberOfDays"=>"90","fileName"=>"custom.log","compressBackups"=>"true"})
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Display Custom Handler
- Use the
read-resource
operation with the following syntax. Replace CUSTOMHANDLER with the name of the custom handler./subsystem=logging/custom-handler=CUSTOMHANDLER:read-resource
/subsystem=logging/custom-handler=CUSTOMHANDLER:read-resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.76. Display a custom handler configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Log Level
- Use the
write-attribute
operation with the following syntax. Replace CUSTOMHANDLER with the name of the log category and LEVEL with the log level that is to be set./subsystem=logging/custom-handler=CUSTOMHANDLER:write-attribute(name="level", value="INFO")
/subsystem=logging/custom-handler=CUSTOMHANDLER:write-attribute(name="level", value="INFO")
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.77. Set the Log Level
[standalone@localhost:9999 /] /subsystem=logging/custom-handler="MyCustomHandler":write-attribute(name="level", value="TRACE") {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/custom-handler="MyCustomHandler":write-attribute(name="level", value="TRACE") {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove Custom Handler
- Use the
remove
operation with the following syntax. Replace CUSTOMHANDLER with the name of the custom handler to be removed./subsystem=logging/custom-handler=CUSTOMHANDLER:remove
/subsystem=logging/custom-handler=CUSTOMHANDLER:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 12.78. Remove a custom handler
[standalone@localhost:9999 /] /subsystem=logging/custom-handler="MyCustomHandler":remove {"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=logging/custom-handler="MyCustomHandler":remove {"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.10. Configure a Syslog Handler in the CLI 复制链接链接已复制到粘贴板!
Syslog
protocol (RFC-3164 or RFC-5424). This allows the log messages of multiple applications to be sent to the same server, where they can be parsed together. This topic covers how to create and configure a syslog handler using the Management CLI, and the available configuration options.
Prerequisites
- Access and the correct permissions for the Management CLI.
Procedure 12.4. Add a Syslog Handler
- Run the following command to add a syslog handler:
/subsystem=logging/syslog-handler=HANDLER_NAME:add
/subsystem=logging/syslog-handler=HANDLER_NAME:add
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 12.5. Configure a Syslog Handler
- Run the following command to configure a syslog handler attribute:
/subsystem=logging/syslog-handler=HANDLER_NAME:write-attribute(name=ATTRIBUTE_NAME,value=ATTRIBUTE_VALUE)
/subsystem=logging/syslog-handler=HANDLER_NAME:write-attribute(name=ATTRIBUTE_NAME,value=ATTRIBUTE_VALUE)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 12.6. Remove a Syslog Handler
- Run the following command to remove an existing syslog handler:
/subsystem=logging/syslog-handler=HANDLER_NAME:remove
/subsystem=logging/syslog-handler=HANDLER_NAME:remove
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3.11. Configure a Custom Log Formatter in the CLI 复制链接链接已复制到粘贴板!
In addition to the log formatter syntax specified in Section 12.1.16, “Log Formatter Syntax”, a custom log formatter can be created for use with any log handler. This example procedure will demonstrate this by creating a XML formatter for a console log handler.
Prerequisites
- Access to the Management CLI for the JBoss EAP 6 server.
- A previously configured log handler. This example procedure uses a console log handler.
Procedure 12.7. Configure a Custom XML Formatter for a Log Handler
- Create custom formatter.In this example, the following command creates a custom formatter named
XML_FORMATTER
that uses thejava.util.logging.XMLFormatter
class.[standalone@localhost:9999 /] /subsystem=logging/custom-formatter=XML_FORMATTER:add(class=java.util.logging.XMLFormatter, module=org.jboss.logmanager)
[standalone@localhost:9999 /] /subsystem=logging/custom-formatter=XML_FORMATTER:add(class=java.util.logging.XMLFormatter, module=org.jboss.logmanager)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Register a custom formatter for the log handler you want to use it with.In this example, the formatter from the previous step is added to a console log handler.
[standalone@localhost:9999 /] /subsystem=logging/console-handler=HANDLER:write-attribute(name=named-formatter, value=XML_FORMATTER)
[standalone@localhost:9999 /] /subsystem=logging/console-handler=HANDLER:write-attribute(name=named-formatter, value=XML_FORMATTER)/subsystem=logging/console-handler=HANDLER:write-attribute(name=named-formatter, value=XML_FORMATTER)/subsystem=logging/console-handler=HANDLER:write-attribute(name=named-formatter, value=XML_FORMATTER)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the JBoss EAP 6 server for the change to take effect.
[standalone@localhost:9999 /] shutdown --restart=true
[standalone@localhost:9999 /] shutdown --restart=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The custom XML formatter is added to the console log handler. Output to the console log will be formatted in XML, for example: