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

com.foreach.across.modules.logging.request.RequestLoggerConfiguration Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2014 the original author or authors
 *
 * 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 com.foreach.across.modules.logging.request;

import lombok.NonNull;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Collection;
import java.util.Collections;

/**
 * @author Arne Vandamme
 */
@ConfigurationProperties("logging.request")
public class RequestLoggerConfiguration
{
	/**
	 * Paths to be included for logging.
	 */
	private Collection includedPathPatterns;

	/**
	 * Paths to always be excluded from logging.
	 */
	private Collection excludedPathPatterns;

	/**
	 * Servlet path patterns that should be logged.
	 */
	private Collection urlFilterMappings = Collections.singleton( "/*" );

	/**
	 * Servlet names that should be included for logging.
	 */
	private Collection servletNameFilterMappings = Collections.emptySet();

	/**
	 * Log levels to be used for request duration.
	 */
	private LoggerLevelThreshold loggerLevelThreshold;

	public Collection getIncludedPathPatterns() {
		return includedPathPatterns;
	}

	public void setIncludedPathPatterns( Collection includedPathPatterns ) {
		this.includedPathPatterns = includedPathPatterns;
	}

	public Collection getExcludedPathPatterns() {
		return excludedPathPatterns;
	}

	public void setExcludedPathPatterns( Collection excludedPathPatterns ) {
		this.excludedPathPatterns = excludedPathPatterns;
	}

	public Collection getUrlFilterMappings() {
		return urlFilterMappings;
	}

	public void setUrlFilterMappings( @NonNull Collection urlFilterMappings ) {
		this.urlFilterMappings = urlFilterMappings;
	}

	public Collection getServletNameFilterMappings() {
		return servletNameFilterMappings;
	}

	public void setServletNameFilterMappings( @NonNull Collection servletNameFilterMappings ) {
		this.servletNameFilterMappings = servletNameFilterMappings;
	}

	public void setLoggerLevelThreshold( LoggerLevelThreshold loggerLevelThreshold ) {
		this.loggerLevelThreshold = loggerLevelThreshold;
	}

	public LoggerLevelThreshold getLoggerLevelThreshold() {
		return loggerLevelThreshold;
	}

	public static RequestLoggerConfiguration allRequests() {
		return new RequestLoggerConfiguration();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy