logback

logback 日志相关配置文件





<configuration>
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder charset="UTF-8">
			<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%npattern>
		encoder>
	appender>

	<appender name="FILE"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${user.home}/logs/consolelogs/rocketmq-console.logfile>
		<append>trueappend>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${user.home}/logs/consolelogs/rocketmq-console-%d{yyyy-MM-dd}.%i.log
			fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy
				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<maxFileSize>104857600maxFileSize>
			timeBasedFileNamingAndTriggeringPolicy>
			<MaxHistory>10MaxHistory>
		rollingPolicy>
		<encoder>
            <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%npattern>
			<charset class="java.nio.charset.Charset">UTF-8charset>
		encoder>
	appender>

	<root level="INFO">
		<appender-ref ref="STDOUT" />
		<appender-ref ref="FILE" />
	root>

configuration> 

你可能感兴趣的:(项目开发SSM,boot要点,logback,日志,xml)