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

ru.dmerkushov.loghelper.configure.loggerwrapper.ConsoleConfigurator Maven / Gradle / Ivy

Go to download

A library to help use different logging frameworks, such as java.util.logging (JUL) and Apache Log4j, even together. See also https://github.com/dmerkushov/log-helper-examples

The newest version!
/*
 * Copyright 2014 dmerkushov.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ru.dmerkushov.loghelper.configure.loggerwrapper;

import java.util.logging.ConsoleHandler;
import org.w3c.dom.Node;
import ru.dmerkushov.loghelper.LoggerWrapper;
import ru.dmerkushov.loghelper.formatter.DefaultFormatter;

/**
 *
 * @author Dmitriy Merkushov
 */
public class ConsoleConfigurator extends LoggerWrapperConfigurator {

	public ConsoleConfigurator (LoggerWrapper loggerWrapper, Node configuration) {
		super (loggerWrapper, configuration);
	}

	@Override
	public boolean configure () {
		ConsoleHandler consoleHandler = new ConsoleHandler ();
		consoleHandler.setFormatter (new DefaultFormatter ());
		
		loggerWrapper.addLoggerHandler (consoleHandler);

		return true;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy