How can I configure my SLF4J logger to print to the console in EAP 6?
Environment
- JBoss Enterprise Application Platform (EAP) 6.x
Issue
- How can I configure my SLF4J logger to print to the console in EAP 6?
Resolution
SLF4J should work "out of the box", meaning you shouldn't have to configure anything for your SLF4J logger to print to the console. For an example of this, take the attached slf4jLog4jTest.jar (also available on github)and deploy it to a stock EAP 6.0 installation. Upon deployment it should print out two log statements, one from a Log4J logger and another from an SLF4J logger. The source is included in the jar if you want to see how it's coded.
Note that slf4j*.jar is not packaged with the deployment. JBoss provides its own implementation of SLF4J that integrates cleanly with its own logging subsystem.
Attachments
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
