WildFly Logging Subsystem CLI Configuration: Difference between revisions
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
<pre> | <pre> | ||
/subsystem=logging/periodic-rotating-file-handler= | batch | ||
/subsystem=logging/periodic-rotating-file-handler=TEST:add(file={"path"=>"test.log", "relative-to"=>"jboss.server.log.dir"}, suffix=".yyyy-MM-dd", append="true") | |||
/subsystem=logging/periodic-rotating-file-handler=TEST:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") | |||
/subsystem=logging/periodic-rotating-file-handler=TEST:write-attribute(name="autoflush", value="true") | |||
run-batch | |||
</pre> | </pre> | ||
System properties can be specified without "${}" | System properties can be specified without "${}" | ||
The "formatter" attribute specified above expands as: | |||
<pre> | |||
<periodic-rotating-file-handler ...> | |||
... | |||
<formatter> | |||
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> | |||
</formatter> | |||
... | |||
</periodic-rotating-file-handler> | |||
</pre> | |||
The result of the above set of CLI operations is: | |||
<pre> | |||
</pre> | |||
For general considerations on adding arbitrary management nodes and attributes see: | For general considerations on adding arbitrary management nodes and attributes see: |
Revision as of 04:27, 16 November 2016
Internal
Adding a Periodic Rotating File Log Handler
batch /subsystem=logging/periodic-rotating-file-handler=TEST:add(file={"path"=>"test.log", "relative-to"=>"jboss.server.log.dir"}, suffix=".yyyy-MM-dd", append="true") /subsystem=logging/periodic-rotating-file-handler=TEST:write-attribute(name="formatter", value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") /subsystem=logging/periodic-rotating-file-handler=TEST:write-attribute(name="autoflush", value="true") run-batch
System properties can be specified without "${}"
The "formatter" attribute specified above expands as:
<periodic-rotating-file-handler ...> ... <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> </formatter> ... </periodic-rotating-file-handler>
The result of the above set of CLI operations is:
For general considerations on adding arbitrary management nodes and attributes see:
Removing a Log Handler
/subsystem=logging/file-handler=INFINISPAN:remove
A log handler can only be removed if it is not being referenced by a log category or an async log handler. No restart is required.
For general considerations on removing an arbitrary management model node: