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

jadex.logger.GraylogExternalLoggerProvider Maven / Gradle / Ivy

package jadex.logger;

import java.lang.System.Logger;

import org.graylog2.logging.GelfHandler;

public class GraylogExternalLoggerProvider implements IExternalLoggerProvider
{
	public Logger getLogger(String name)
	{
		GraylogLogger ret = new GraylogLogger(name);
		java.util.logging.Logger logger = ret.getLoggerImplementation();
        logger.setUseParentHandlers(false);
        GelfHandler handler = new GelfHandler();
        handler.setGraylogHost("localhost");
        handler.setGraylogPort(12201);
        logger.addHandler(handler);
        return ret;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy