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

r.starter.apps.gateway.gateway-webservice.1.3.2.source-code.logback-spring.xml Maven / Gradle / Ivy

There is a newer version: 1.3.4
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<configuration>
	<springProfile name="${APP_SERVER_MODE:-development}">
		<property name="LOG_PATH" value="${LOG_PATH:-${LOG_DIR}}"/>
		
		<appender name="rollingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
			<file>
				${LOG_PATH}/server.log
			</file>
			
			<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
				<pattern>
					GATEWAY | ${hostName} | %d{yyyy-MM-dd HH:mm:ss.SSS} | %thread | %-5level | %logger{32}:%M:%L | %X{mdcData} | %msg%n
				</pattern>
			</encoder>
			
			<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
				<!-- Hourly roll over -->
				<fileNamePattern>
					${LOG_PATH}/server-%d{yyyy-MM-dd-HH}-%i.log
				</fileNamePattern>
				
				<!-- Preserve logs for 3 months -->
				<maxHistory>
					3
				</maxHistory>
				
				<!-- Roll files after given size -->
		    		<maxFileSize>
		    			64MB
		    		</maxFileSize>
			</rollingPolicy>
		</appender>
	
		<logger name="rollingFileLogger" level="INFO">
			<appender-ref ref="rollingFileAppender" />
		</logger>
		
		<root level="INFO">
	        <appender-ref ref="rollingFileAppender" />
	    </root>
	</springProfile>
	
	<springProfile name="console">
		<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
	        <encoder>
	            <pattern>
					GATEWAY | ${hostName} | %d{yyyy-MM-dd HH:mm:ss.SSS} | %thread | %-5level | %logger{32}:%M:%L | %X{mdcData} | %msg%n
				</pattern>
	        </encoder>
	    </appender>
    
		<logger name="rollingFileLogger" level="INFO">
			<appender-ref ref="consoleAppender" />
		</logger>
		
		<root level="INFO">
	        <appender-ref ref="consoleAppender" />
	    </root>
	</springProfile>
</configuration>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy