springboot的logback的配置檔案

2022-01-11 15:07:45 字數 588 閱讀 5537

之前敲出來乙個 logback 的配置檔案,防止以後找起來麻煩在這裡存個檔

修改了日誌輸出的內容

設定預設級別為 info

正常日誌 ( trace 到 warn ) 輸出到單獨的資料夾

異常日誌 ( error ) 輸出到單獨的資料夾

日誌檔案按天進行儲存,每天都會新建日誌檔案

日誌檔案儲存在當前專案目錄下

配置檔案命名為logback-spring.xml放到resources目錄下會自動生效,**如下:

<?xml version="1.0" encoding="utf-8" ?>

%d [%p][%c][%m][%l]——> %m%n

error

deny

accept

%d [%p][%c][%m][%l]——> %m%n

info/%d.log

error

%d [%p][%c][%m][%l]——> %m%n

error/%d.log

ELK日誌收集分析系統搭建筆記之Logback篇

前面記錄了搭建環境等步驟,完成了日誌檔案內容通過logstash輸出到es,再到kibana展示等一系列步驟。這一篇文章記錄了由logback.xml通過tcp通道方式傳送日誌到logstash,由logstash傳輸到es,kibana展示。環境配置 logstash,es,kibana,搭建在雲...

Springboot的thymeleaf常用屬性

th text對特殊字元進行轉義,作為純文字標籤,等價於內聯方式 welcome to thymeleaf welcome to thymeleaf th utext 對特殊字元不進行轉義,可以顯示出字元的作用,等價於內聯方式 welcome to thymeleaf welcome to thym...

spring boot的Scheduler定時任務

configuration enablescheduling 開啟後台任務 public class scheduler cron second,minute,hour,day of month,month,day s of week scheduled cron 0 每分鐘執行一次 schedul...