(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) { &...
(1).final 修饰符通常和 static 修饰符一起使用来创建类常量。(2).父类中的 final 方法可以被子类继承,但是不能被子类重写,声明 final 方法的主要目的是防止该方法的内容被修改。public class Member {  ...
java stringBuffer(1).stringBuffer和stringBuilder区别stringBuffer是线程安全的,stringBuilder速度更快(2).简单的stringBuffer例子StringBuffer sBuffer = new&nb...
(1).创建数组double[] myList = new double[size]; //推荐创建方式 double myList[] = new double[size];  ...
System.out.println("当前时间戳(秒): " + System.currentTimeMillis()/1000); System.out.println("当前时间戳(毫秒): " +&nb...
java匹配一个字符串在另外一个字符串中出现的次数,java正则start,java正则end// 正则 String pattern = "\\bgao\\b"; // 字符串 String content ...