AlertLogToFile2

Thu May 28 01:04:42 EDT 2009

This Handler writes a formatted line for alerts. You can place an instance of this handler in the following folders: isValid, isClear, superceded, and forcedClear. Be sure to use the %STATUS% substitution so you can tell the difference if you use more than one folder.

This handler always returns 'true'. It should be placed as the last AND condition in any handler chain so that the log is only written when the other handlers agree.

The variables available for substitution in the 'format' setting are: %RULE_NODE%, %ALERT_COUNT%, %GATEWAY%, %ONUS%, %TASK_GROUPS%, %COMPANY%, %SERVER%, %ELEMENT%, %SUMMARY%, %TIME_ALERT%, %TIME_NOW%, and %STATUS% (one of "ALERT", "CLEAR", "SUPERCEDED", or "FORCED"). Additionally, any variable parsed in the rule tree, or enriched via a handler, may be referenced. This may be useful for "tagging" alerts for easier post-processing. Note: All times substitutions are in milliseconds since 1970 GMT.

As handler hook fires, a line of fields (defined in the 'format' setting) is written to a log file. The file is named via the three 'file.*' settings. The 'file.date' setting defines a date format, using standard Java codes. The period between rolling to a new log file is effectively controlled by this format. If the format only defines a calendar date (default), then the file will be rotated each day; if the format includes the hour of the day, then the file will rotate on the hour. A purger automatically maintains the directory based on the 'purge.*' settings. The purger runs nightly at 12:09 AM.

WARNING: This handler is not thread-safe, so you should create a new instance for each gateway.