Search code examples
javalog4jslf4jlogbackjclouds

Jclouds logging with SLF4j + log4j instead of SLF4J + logback


I'm not a Java expert, but I'm working on a project which already uses SLF4J + log4j. I'm adding Jclouds as a dependency and I saw that it used SLF4J + logback. Is it possibile to use SLF4J + log4j event for Jclouds?


Solution

  • SLF4J is supported, that is clear. And I just found the following (apache-written) library:

    JClouds-log4j

    which indicates that log4j is natively supported as well. This means that you will have no problem using slf4j with log4j, altough it is worth mention, that slf4j with logback seems to be the more "modern" approach. Of course if you have some specific reason (dealing with a legacy app for example) to stick to log4j, then you should go with that one.