在初學使用Jenkins的同學們,應該都遇到過通過bash或者cmd命令執行輸出的日志,沒辦法做到對error, warning等狀態的分析和統計。在這里就給他介紹一款實現此功能的插件Log Parse。此插件安裝相當容易,但配置規則文件時,我踩了一坑,記錄共享于同學們。
規則文件絕對路徑
當然,你的設置一定要重新加載,否則是無效的
規則文件相對路徑:
在windows平臺下,默認的根目錄為C:\Windows\.SysWOW64\,所以需要把規則文件放到此目錄下。
常用規則文件代碼如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
ok /not really/ # match line starting with 'error ' , case -insensitive error /error / # list of warnings here... warning /[Ww]arning/ warning /WARNING/ # create a quick access link to lines in the report containing 'INFO' info /INFO/ # each line containing 'BUILD' represents the start of a section for grouping errors and warnings found after the line. # also creates a quick access link. start /BUILD/ |
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。
原文鏈接:https://www.cnblogs.com/cqhaibin/archive/2018/08/26/9539057.html