(1).配置文件增加如下内容:
application.properties
(2).创建\src\main\resources\logback-spring.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<!-- 设置日志文件路径,${log.path}变量的值 -->
<property name="log.path" value="logs" />
<!-- 配置日记记录格式 -->
<springProfile name="staging">
<appender name="STAGING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
<file>${log.path}/staging.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/staging.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<root level="INFO">
<appender-ref ref="STAGING" />
</root>
</springProfile>
</configuration>public class test { public static void main(String[] args) { &...
public class test { public static void main(String[] args) { &...
java stringBuffer(1).stringBuffer和stringBuilder区别stringBuffer是线程安全的,stringBuilder速度更快(2).简单的stringBuffer例子StringBuffer sBuffer = new&nb...
(1).java睡眠函数Thread.sleep(时间); //单位为毫秒(2).java睡眠函数例子Date dNow = new Date(); SimpleDateFormat ft = new&nbs...
System.out.println("当前时间戳(秒): " + System.currentTimeMillis()/1000); System.out.println("当前时间戳(毫秒): " +&nb...
(4).java lookingAt匹配字符串和java matches匹配字符串lookingAt不要求整个字符串全匹配,例如me和me_you都是匹配的,但是lookingAt从第一个字符串开始匹配,匹配失败了也不会继续匹配,意味着me和you_me是无法匹配的matches匹配字符串要求全部匹...