在Controller接收外部傳入的參數時通常要驗證參數是否合法(例如金額不得小於0、結束日不能超過起始日、字串長度限制等),若驗證失敗時應該用什麼的log level輸出日誌?
2020/5/28
2019/9/1
Spring Boot Log4j2 Maven Gradle dependencies 設定
Spring Boot的spring-boot-starter-logging預設是依賴logback,若同時又加入了log4j的依賴,就會導致classpath下有logback與log4j兩個日誌框架,並造成Spring Boot SLF4J: Class path contains multiple SLF4J bindings.的警告。
Spring Boot SLF4J: Class path contains multiple SLF4J bindings.
啟動Spring Boot專案時,出現錯誤SLF4J: Class path contains multiple SLF4J bindings.如下。
2019/8/30
Log4j2 日誌輸出的預設等級 root logger default logger level
當使用Log4j2作為程式的日誌輸出函式庫時,若log4j2找不到任何配置文件(例如classpath下的log4j2.properties或log4j2.xml),
預設會使用root logger輸出日誌,且日誌輸出級別預設為Level.ERROR。
2019/1/8
訂閱:
文章 (Atom)