How to define custom log level in WildFly 10

888 views Asked by At

In standalone.xml we have the following:

<root-logger>
  <level name="INFO"/>
  <handlers>
    <handler name="CONSOLE"/>
    <handler name="FILE"/>
  </handlers>
</root-logger>

How can I add something like:

<level name="MYLEVEL"/>

Is this possible to do in WildFly 10 Server?

1

There are 1 answers

2
jmehrens On BEST ANSWER

The standard java.util.logging.Level used by the LogManager allows you to pass an integer value of your custom level. For example, if your MYLEVEL has a value of 2000 you can use the number instead of the name.

<root-logger>
  <level name="2000"/>
  <handlers>
    <handler name="CONSOLE"/>
    <handler name="FILE"/>
  </handlers>
</root-logger>

To use a custom level by the level name you have to include that binary in the boot class path.