1、寫定時任務刪除日誌文件java
# crontab -e * * * * */1 rm -rf /var/log/jenkins/*
2、修改jenkins日誌的級別git
/var/lib/jenkins/logging.properties .level = INFO handlers= java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter hudson.security.csrf.CrumbFilter.level = SEVERE hudson.plugins.git.GitStatus.level = SEVERE
/var/lib/jenkins/ init.groovy.d / logging.groovy import java.util.logging.Level import java.util.logging.Logger Logger.getLogger("hudson.plugins.git.GitStatus").setLevel(Level.SEVERE) Logger.getLogger("hudson.security.csrf.CrumbFilter").setLevel(Level.SEVERE)
3、修改jenkins日誌設置
系統設置--->日誌設置-->shell