package at.gv.egiz.eaaf.utils.springboot.ajp.logging; import java.util.Collections; import java.util.List; import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; import lombok.Getter; import lombok.Setter; /** * Logger configuration for embedded Tomcat. * * @author BRZ development team * @author tlenz * */ @ConfigurationProperties(prefix = "logging") @Getter @Setter public class LoggingProperties { /** * Whether to log in JSON format. */ private boolean json = true; /** * Whether to log in plain text. */ private boolean text = false; /** * Default Logback Pattern. */ private String pattern = "### unused property ###"; /** * Logback Mapped Diagnostic Context. */ private Mdc mdc = new Mdc(); /** * Logback Mapped Diagnostic Context. */ @Getter @Setter public static class Mdc { /** * Whether to use Logback's MDC. */ private boolean enabled = false; /** * A Map of [MDCKey, HttpHeaderName] tuples that are to be saved into MDC. */ private Map headerMap = Collections.emptyMap(); /** * List of HTTP Cookies to make available in Logback's MDC. */ private List cookies = Collections.emptyList(); private String cookiePrefix = ""; private String cookiePostfix = ""; /** * List of HTTP Session Attributes to make available in Logback's MDC. */ private List sessionAttributes = Collections.emptyList(); private String sessionAttributePrefix = ""; private String sessionAttributePostfix = ""; /** * Value to use if a configured MDC entry would be null. */ private String nullValue = null; } /** * Tomcat AccessLog. */ private AccessLog accessLog = new AccessLog(); /** * Tomcat AccessLog. */ @Getter @Setter public static class AccessLog { /** * Enable AccessLog. */ private boolean enabled = false; /** * Logback access log filename. */ private String filename = "logback-access.xml"; } }