wrapper.filter.<x>.<n> Property Overview |
Filters are a very powerful feature that makes it possible to add new behavior to existing applications without any coding. It works by monitoring the console output of a JVM for sequences of text. When they are found, any number of actions can then be taken. One example is initiating a JVM restart whenever a specific error occurs. Some applications have known bugs where they stop working once getting into a certain state. This feature makes it possible to work around such problems immediately until they can be resolved in the application. Properties used to configure filters are described below:
At the very least, a filter must define the
wrapper. <n> component:
In each filter, the "<n>" component of the property name is an integer number counting up from "1".
By default, there can be no missing numbers.
The wrapper. The Wrapper will scan the defined filters in incremental order using their <n> number. As soon as a filter is matched, the process will stop for that line of output. |
wrapper.filter.trigger.<n> |
||||||||||
The trigger can be any string, and the following property is required for its configuration.
Spaces In Trigger: The string being filtered can contain spaces. But due to the way the configuration properties are loaded in general, any leading or trailing spaces will be trimmed when the property is loaded.
Wildcards:
Starting with Wrapper version 3.5.5, it is
now possible to include wildcards ('*' or '?') in the trigger text if the
wrapper. Valid wildcard characters are:
NOTATrigger values will be located someplace within a single line of output, so it is not necessary to precede or trail a value with a "*" wildcard. Please be aware that doing so will actually hurt the logging performance a bit, as it makes it much more difficult for the pattern matching to determine that a given trigger is NOT found in a line of log output. |
wrapper.filter.action.<n> |
||||||||||
Specifying an action requires the following property to be configured. If an action is omitted, it will default to RESTART.
Possible actions are:
Chaining Multiple Actions: Starting with Wrapper version 3.5.0, it is possible to specify more than one action by separating them with a space or comma. When more than one action is specified, they will be executed in rapid succession in the order specified. Matching with the trigger, the following example will perform a thread dump and then restart the JVM.
|
wrapper.filter.allow_wildcards.<n> |
||||||||
If set to TRUE, this property tells the Wrapper to process any wildcards found in
wrapper.
NOTAIt is not that bad, but searching for a trigger containing a wildcard can be a bit more CPU intensive. This is especially true with long lines of output when the trigger's wildcards are towards the beginning of the trigger. Multiple wildcards in the same trigger will also slow things down, as the Wrapper needs to try all possible combinations to see if the pattern is matched. |
Usage Examples: |
||||||||||||||||||||||||||||||||||||||
In this section, we will show you several examples of how to make use of triggers. Filters work by monitoring the console output of the JVM. In order for a trigger to be fired by an exception, the Java application must print the message being filtered to the console.
|