Overview

Imports log messages data from xml files in pi diagnostics format.

To use this import in FEWS configuration: <importType>piDiagnostics</importType>
Unlike other import types, this does not import time series, but only log messages.
No time series need to be configured using this import.

Elements

Line levels

The following Line Levels are allowed:

  • 4 = debug All levels higher than 3 are regarded as non-essential (debug) information
  • 3 = info (information, all is well, e,g, :"SOBEK: program ended")
  • 2 = warn (warning information. e.g. "SOBEK: high number of iterations")
  • 1 = error (critical problems. e.g. "SOBEK: no convergence")
  • 0 = fatal (full module crash. e.g. "SOBEK: ooops, what now?")

description

This can be any string.

Eventcode

See EventCodes for the function of EventCodes. Most model adapters don't return Event Codes in their diagnostics files: those will be provided by FEWS.

Example

Here is an example:

PiDiagnostics.xml
<?xml version="1.0" encoding="UTF-8"?>
<Diag xmlns="http://www.wldelft.nl/fews/PI"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_diag.xsd" version="1.2">
  <!--1 or more repetitions:-->
    <line level="0" description="Level 0 message mapped to ERROR" eventCode="EventCode.ERROR"/>
    <line level="1" description="Level 1 message mapped to ERROR" eventCode="EventCode.ERROR"/>
    <line level="2" description="Level 2 message mapped to WARN" eventCode="EventCode.WARN"/>
    <line level="3" description="Level 3 message mapped to INFO" eventCode="EventCode.INFO"/>
    <line level="4" description="Level 4 message mapped to DEBUG" eventCode="EventCode.DEBUG"/>
    <line level="5" description="Level 5 message mapped to DEBUG" eventCode="EventCode.DEBUG"/>
	<line level="0" description="Level 0 message mapped to ERROR" />
	<line level="1" description="Level 1 message mapped to ERROR" />
	<line level="2" description="Level 2 message mapped to WARN" />
	<line level="3" description="Level 3 message mapped to INFO" />
	<line level="4" description="Level 4 message mapped to DEBUG" />
	<line level="5" description="Level 5 message mapped to DEBUG" />
</Diag>

This file is also available for download in the attachments: PiDiagnostics.xml

Details of the import format

The xsd describing the xml format can be found here:

http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_diag.xsd

The parser reads the xml file and logs the messages to FEWS according to their log level.
If an event code is present in the element it is used otherwise default event codes are used.

The PiDiagnostics.xml example file will result in the following FEWS log messages

04-07-2014 15:52:08 ERROR - EventCode.ERROR: Level 0 message mapped to ERROR
04-07-2014 15:52:08 ERROR - EventCode.ERROR: Level 1 message mapped to ERROR
04-07-2014 15:52:08 WARN - EventCode.WARN: Level 2 message mapped to WARN
04-07-2014 15:52:08 INFO - EventCode.INFO: Level 3 message mapped to INFO
04-07-2014 15:52:08 DEBUG - EventCode.DEBUG: Level 4 message mapped to DEBUG
04-07-2014 15:52:08 ERROR - GA.Execution.Model.Error: In adapter model: Level 0 message mapped to ERROR
d:\Data\FEWS_Issues\FEWS-11214_PiDiagnosticsImport\piDiagnostics.xml
04-07-2014 15:52:08 ERROR - GA.Execution.Model.Error: In adapter model: Level 1 message mapped to ERROR
d:\Data\FEWS_Issues\FEWS-11214_PiDiagnosticsImport\piDiagnostics.xml
04-07-2014 15:52:08 WARN - GA.Execution.Model.Warn: In adapter model: Level 2 message mapped to WARN
04-07-2014 15:52:08 INFO - GA.Execution.Model.Info: In adapter model: : Level 3 message mapped to INFO
04-07-2014 15:52:08 DEBUG - GA.Execution.Model.Debug: Level 4 message mapped to DEBUG

Java source code

PiDiagnosticsParser.java

  • No labels