Additions to QLA filter.

MXS-848 (partially). The QLA-filter now has additional options
to control the printing.
1. "append"
This toggles append-mode, where the filter opens the log files in
update mode (if file already existed) and only adds text to the end.
2. "print_service"
This toggles writing the service name onto each row. Mostly useful
with the unified_file-setting.
3. "print_session"
This toggles writing the session number onto each row. Mostly useful
with the unified_file-setting.

Also, the filter now writes a header to the beginning of the file
when creating it.

The printing has been separated to its own helper-function, in case
more accurate control will be added in the future.
This commit is contained in:
ekorh475
2016-11-29 13:06:56 +02:00
parent 9df3f154cf
commit a64825c866
2 changed files with 347 additions and 50 deletions

View File

@ -25,14 +25,18 @@ filters=MyLogFilter
The QLA filter accepts the following options.
|Option |Description |
|----------|--------------------------------------------|
|ignorecase|Use case-insensitive matching |
|case |Use case-sensitive matching |
|extended |Use extended regular expression syntax (ERE)|
|session_file| Use session-specific file (default)|
|unified_file| Use one file for all sessions|
|flush_writes| Flush after every write|
Option | Description
-------| -----------
ignorecase | Use case-insensitive matching
case | Use case-sensitive matching
extended | Use extended regular expression syntax (ERE)
session_file | Write to session-specific files (default)
unified_file | Use one file for all sessions
flush_writes | Flush after every write
append | Append log entries instead of overwriting files
print_service | Add service name to log entries
print_session | Add session id to log entries (ignored for session-files)
To use multiple filter options, list them in a comma-separated list. If no file settings are given, default will be used. Multiple file settings can be enabled simultaneously.
```