Improve logging of package io.moquette.server.config

This commit is contained in:
Luis Barrios
2017-01-11 14:56:16 +01:00
parent 7666a1634a
commit 1592a0676c
3 changed files with 42 additions and 9 deletions
@@ -4,8 +4,13 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ClasspathResourceLoader implements IResourceLoader {
private static final Logger LOG = LoggerFactory.getLogger(ClasspathResourceLoader.class);
private final String defaultResource;
private final ClassLoader classLoader;
@@ -29,6 +34,7 @@ public class ClasspathResourceLoader implements IResourceLoader {
@Override
public Reader loadResource(String relativePath) {
LOG.info("Loading resource. RelativePath = {}.", relativePath);
InputStream is = this.classLoader.getResourceAsStream(relativePath);
return is != null ? new InputStreamReader(is) : null;
}