Search code examples
javaloggingconfigurationwildflywildfly-swarm

How to configure logger level to FINEST for Wildfly Swarm


I have followed this guide for project*.yml.

I created two files under src/main/resources:

project-default.yml which contains:

logger:
  level: INFO
swarm:
  http:
    port: 80

and project-dev.yml which contains:

logger:
  level: FINEST
swarm:
  http:
    port: 8080

I have successfully switched between them by using the flagg -Dswarm.project.stage=dev, verifying that the port is actually changed.

By some reason when using the dev-profile the application refuses to logg anything logged with logger.finest(...) while when using logger.info(...) it is logged correctly.

Did I configure the logging levels incorrectly? In that case, how should they be configured?


Solution

  • This is wrong:

    logger:
      level: WHATEVER
    

    For logging, Wildfly Swarm relies on the logging WildFly subsystem, similarly to other functionalities. So the correct YAML snippet is:

    swarm:
      logging:
        ...
    

    For example:

    swarm:
      logging:
        root-logger:
          level: FINE