All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quotemedia.streamer.client.util.LoggerConfig Maven / Gradle / Ivy

Go to download

Java streaming client that provides easy-to-use client APIs to connect and subscribe to QuoteMedia's market data streaming services. https://quotemedia.com/

The newest version!
package com.quotemedia.streamer.client.util;

import org.apache.log4j.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * wrapper utility class for log4j config
 */
public class LoggerConfig {
    public static final Level LVL_ALL = Level.ALL;
    public static final Level LVL_WARN = Level.WARN;
    public static final Level LVL_INFO = Level.INFO;
    public static final Level LVL_DEBUG = Level.DEBUG;
    public static final Level LVL_TRACE = Level.TRACE;

    private static final Logger log = LoggerFactory.getLogger(LoggerConfig.class);

    // Use log4j logger to be able to change the level (not available in the slf4j api)
    private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getRootLogger();

    public static void setLogRootLevel(Level level) {
        logger.setLevel(level);
        log.info("Log level set to: {}", level.toString());
    }

    public static String getCurrentLevel() {
        return logger.getLevel().toString();
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy