{jenkins-plugin-info:pluginId=log-parser}

Parse the console output and highlight error/warning/info lines.

Description

The log-parser plugin parses the console log generated by the Jenkins build. Parsing the console log allows for the following features:

Parsed log example

Summary at build level

This shows a summary of errors and warnings on the build page

The parsed log

This is an example of a parsed log of a build.
It is accessible from the "Parsed Console Output" link on the left side of the build page :



The left side of the report can be expanded to browse the errors/warning/info lines. These lines are links to the full log on the right, where they can be easily located. Clicking on a certain error will bring you right to it on the full log which appears on the right side of the screen. The log is also divided into logical sections (as defined in the parsing rules configuration described below). In the summary section on the left you can see the errors/warnings as they appear in the log sections. This can help understand in what part of the build there is an error/warning. Both summary and log sections are scrollable and expandable.



Configuration

Several parsing options are configured at the global level.

Global Configuration

Parsing rules options

Appears in the global Jenkins configs as section "Console Output Parsing"
Configure pairs of logical names (project, description, etc.) and parsing rule files.
Later on, when a job is configured for log parsing, you will be able to choose one of these configurations to implement as the parsing rules for that job. (See "Job Configuration")



For each parsing rules option, specify :
Parsing rule name - logical name which will be displayed in the job level configuration as an option
Parsing Rules File - A file with the parsing rules implemented in this option. (See "Parsing rules files" to learn more about the syntax of these files.)

Parsing rules files

Format

Each line in the file specifies a level (ok/error/warn/info/start) and a regular expression (based on java.util.regex.Pattern) delimited by slashes ("/") to look for in order to mark the line as matching that level.

For example, the following line in the parsing rules file means that a line including the word "ERROR" will be marked as an error line:

error /ERROR/

Example parsing rules file:

ok /not really/

# match line starting with 'error ', case-insensitive
error /(?i)^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/

Job Configuration

  1. Go to menu: Jenkins -> job name -> Configure
  2. Go to section : Post-build Actions
  3. Check the "Console output (build log) parsing" checkbox.
  4. "Mark build Unstable on Warning" option: check to have parsed warnings mark the build 'unstable'.
  5. "Mark build Failed on Error" option : check to have parsed errors mark the build 'failed'.
  6. "Select Parsing Rules" : select the set of rules to use for parsing the logs of this job's builds
    (Notice that this list is derived from the global configuration )



Changelog

Version 2.0 (October 20, 2015)

Version 1.0.8 (December 14, 2010)

Useful parse lines

This section collects some useful additional parse-statements contributed by users of the Log Parser Plugin

JaCoCo code coverage fails to read class-data
error /Execution data for class .* does not match./