Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

RedDeer logging system

jpeterka edited this page Jun 2, 2015 · 16 revisions

Logging in RedDeer is similar to any other logging system like log4j or others. There are some differences though. First, it is much more simple and doesn't require any xml configuration. On the other hand it doesn't provide as fine and complex possibilities as log4j does (like custom formatting, etc.). It also brings some additional logging types which are not available in log4j and which are handy for UI testing.

Using the logger

When you want to use the logger in your your class you just must define Logger from org.jboss.reddeer.common.logging package.

private final Logger log = Logger.getLogger(WorkbenchPreferenceDialog.class);

then you can log your messages by using the logger

log.info("Server " + serverName + " is started");

Log types

Log message type Usage description
FATAL fatal message are mostly for reporting halt state or other serious issues
ERROR error message for reporting any unexpected state and errors
DUMP should be used after error message to provide additional useful information related to the error
STEP describes hi-level test steps describing high level test flow, should used only in test class
WARN any warning message which indicates anything outside normal state
INFO general type for information type messages
DEBUG low-level debug information usable for analyzing issues and bugs
TRACE low-level trace information that indicates tracking through the code

Log filters

There are these log filter switches that can be used to filter your log for message type or message level according to your needs. You can combine them if needed.

Parameter Default value Type Description Source
logMessageFilter ALL pipe separated string filters log messages according to settings. Possible
logLevel ALL string filters log messages according to settings. Possible values are none,trace,debug,error,warn,info,step,error,fatal,all . Values are case insensitive ExecutionSettings

So for example if you want to see just STEP, INFO and ERROR messages then just add these vm parameters into your : -DlogMessageLevel="step|info|error"

Clone this wiki locally