WildFly CLI - Configuring Logging: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= =Organizatorium= <font color=red> Enable CONSOLE logging: <pre> /subsystem=logging/console-handler=CONSOLE:add(level=INFO,formatter="%K{level}%d{HH:mm:ss,SSS...")
 
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=


* [[WildFly CLI Operations#Subjects|CLI Operations]]


=Configure a New Logger=


==Add the Logger==


=Organizatorium=
Navigate to the appropriate logging subystem ("/subsystem=logging" in standalone mode and "/profile=.../subsystem=logging" in domain mode.


<font color=red>
./logger=<b>''new-logger''</b>:add


Enable CONSOLE logging:
Example:


<pre>
./logger=org.hornetq:add
/subsystem=logging/console-handler=CONSOLE:add(level=INFO,formatter="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n")
/subsystem=logging/root-logger=ROOT:add-handler(name="CONSOLE")
</pre>


==Configure the Logging Level on the Logger==


</font>
From the same "directory"
 
./logger=<b>''new-logger''</b>:write-attribute(name="level", value="<b>''level''</b>")
 
Example:
 
/logger=org.hornetq:write-attribute(name="level", value="TRACE")
 
=Reconfiguring Logging to TRACE=
 
==Configure the ROOT Logger==
 
cd <...>/subsystem=logging
./root-logger=ROOT:write-attribute(name=level,value=TRACE)
 
==Configure the Handler==
 
The actual handler who is supposed to write TRACE data may vary, in this case is the size-rotating-file-handler:
 
cd <...>/subsystem=logging
./size-rotating-file-handler=FILE:write-attribute(name=level,value=TRACE)
 
==Configure Specific Loggers==
 
Configure the specific loggers that should produce TRACE info, as shown here [[WildFly_CLI_-_Configuring_Logging#Configure_the_Logging_Level_on_the_Logger|Configure the Logging Level on the Logger]].
 
=Enable CONSOLE logging=
 
<...>/subsystem=logging/console-handler=CONSOLE:add(level=INFO,formatter="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n")
<...>/subsystem=logging/root-logger=ROOT:add-handler(name="CONSOLE")

Latest revision as of 20:58, 20 July 2017

Internal

Configure a New Logger

Add the Logger

Navigate to the appropriate logging subystem ("/subsystem=logging" in standalone mode and "/profile=.../subsystem=logging" in domain mode.

./logger=new-logger:add

Example:

./logger=org.hornetq:add

Configure the Logging Level on the Logger

From the same "directory"

./logger=new-logger:write-attribute(name="level", value="level") 

Example:

/logger=org.hornetq:write-attribute(name="level", value="TRACE")

Reconfiguring Logging to TRACE

Configure the ROOT Logger

cd <...>/subsystem=logging
./root-logger=ROOT:write-attribute(name=level,value=TRACE)

Configure the Handler

The actual handler who is supposed to write TRACE data may vary, in this case is the size-rotating-file-handler:

cd <...>/subsystem=logging
./size-rotating-file-handler=FILE:write-attribute(name=level,value=TRACE)

Configure Specific Loggers

Configure the specific loggers that should produce TRACE info, as shown here Configure the Logging Level on the Logger.

Enable CONSOLE logging

<...>/subsystem=logging/console-handler=CONSOLE:add(level=INFO,formatter="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n")
<...>/subsystem=logging/root-logger=ROOT:add-handler(name="CONSOLE")