org.slf4j.impl.JDK14LoggerAdapter Java Examples

The following examples show how to use org.slf4j.impl.JDK14LoggerAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommonUtil.java    From FastLogin with MIT License 5 votes vote down vote up
public static Logger createLoggerFromJDK(java.util.logging.Logger parent) {
    try {
        parent.setLevel(Level.ALL);

        Class<JDK14LoggerAdapter> adapterClass = JDK14LoggerAdapter.class;
        Constructor<JDK14LoggerAdapter> cons = adapterClass.getDeclaredConstructor(java.util.logging.Logger.class);
        cons.setAccessible(true);
        return cons.newInstance(parent);
    } catch (ReflectiveOperationException reflectEx) {
        parent.log(Level.WARNING, "Cannot create slf4j logging adapter", reflectEx);
        parent.log(Level.WARNING, "Creating logger instance manually...");
        return LoggerFactory.getLogger(parent.getName());
    }
}
 
Example #2
Source File: CommonUtil.java    From ChangeSkin with MIT License 5 votes vote down vote up
public static Logger createLoggerFromJDK(java.util.logging.Logger parent) {
    try {
        parent.setLevel(Level.ALL);

        Class<JDK14LoggerAdapter> adapterClass = JDK14LoggerAdapter.class;
        Constructor<JDK14LoggerAdapter> cons = adapterClass.getDeclaredConstructor(java.util.logging.Logger.class);
        cons.setAccessible(true);
        return cons.newInstance(parent);
    } catch (ReflectiveOperationException reflectEx) {
        parent.log(Level.WARNING, "Cannot create slf4j logging adapter", reflectEx);
        parent.log(Level.WARNING, "Creating logger instance manually...");
        return LoggerFactory.getLogger(parent.getName());
    }
}
 
Example #3
Source File: ScoreboardStats.java    From ScoreboardStats with MIT License 5 votes vote down vote up
private static Logger createLoggerFromJDK(java.util.logging.Logger parent) {
    try {
        parent.setLevel(Level.ALL);

        Class<JDK14LoggerAdapter> adapterClass = JDK14LoggerAdapter.class;
        Constructor<JDK14LoggerAdapter> cons = adapterClass.getDeclaredConstructor(java.util.logging.Logger.class);
        cons.setAccessible(true);
        return cons.newInstance(parent);
    } catch (ReflectiveOperationException reflectEx) {
        parent.log(Level.WARNING, "Cannot create slf4j logging adapter", reflectEx);
        parent.log(Level.WARNING, "Creating logger instance manually...");
        return LoggerFactory.getLogger(parent.getName());
    }
}