From a8b5c713a19b4dc3c6ea094933d4d57d2630e3cb Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 6 Jun 2012 16:35:48 -0700 Subject: [PATCH] Issue 962:slf4j initializing loggers to null --- .../main/java/org/jclouds/logging/slf4j/SLF4JLogger.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/slf4j/src/main/java/org/jclouds/logging/slf4j/SLF4JLogger.java b/drivers/slf4j/src/main/java/org/jclouds/logging/slf4j/SLF4JLogger.java index 250f959cca..7054a70fe3 100644 --- a/drivers/slf4j/src/main/java/org/jclouds/logging/slf4j/SLF4JLogger.java +++ b/drivers/slf4j/src/main/java/org/jclouds/logging/slf4j/SLF4JLogger.java @@ -22,12 +22,17 @@ import org.jclouds.logging.BaseLogger; import org.jclouds.logging.Logger; /** - * {@link org.apache.slf4j.Logger} implementation of {@link Logger}. + * {@link org.slf4j.LoggerFactory} implementation of {@link Logger}. * * @author Adrian Cole * */ public class SLF4JLogger extends BaseLogger { + static { + // force initialization to avoid http://www.slf4j.org/codes.html#substituteLogger messages + org.slf4j.LoggerFactory.getILoggerFactory(); + } + private final org.slf4j.Logger logger; private final String category;