org.gwizard.logging.LoggingConfig Maven / Gradle / Ivy
package org.gwizard.logging;
import ch.qos.logback.classic.Level;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Logging configuration is drawn from three sources, in three steps:
*
* - Logging configuraton starts with the standard Logback boostrap process (ie, logback.xml).
* - If the 'xml' attribute has any content here, the configuration is replaced wholesale.
* - Any 'loggers' mapped here have their levels overriden appropriately.
*
*
* The optional 'xml' property should be the raw XML of the logback config file. It will
* be fed directly to logback. This actually works pretty well in a YAML file because of the
* nifty block text syntax.
*
* If the xml value is null or empty, we leave the standard Logback boostrap config alone.
*/
@Data
@NoArgsConstructor
public class LoggingConfig {
/** Optional raw xml content for logback config that will replace any preexisting configuration */
private String xml;
/** Override any logging levels specified in either the xml or in the logback bootstrap */
private Map loggers = new LinkedHashMap<>();
/** Sometimes convenient */
public LoggingConfig(String xml) {
this.xml = xml;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy