; This is a sample configuration file for ELAPI

; The dispatcher section defines general configuration
; for the ELAPI. It has following configuration parameters:
;
; targets - (required)
;           Defines possible logical destinations where message can be sent.
;           It is one of the arguments of the calling interface. It is numeric.
;           It is done this way for performance reasons so it is faster to compare.
;           But in the configuration it is easier to deal with targets as strings.
;           To overcome this issue each target is assigned a number in the INI file.
;           The ELAPI convention is to have three default targets:
;           "debug", "audit" and "log" but application developers can add others as needed.
;           The default value for debug target is 1, for audit 2 and log is 4.
;           Changing the value defined for debug to be 7 ( logical OR of 1, 2 and 4)
;           will result in all messages sent into debug log.
;           This might be convenient during troubleshooting and would allow seeing all
;           events emitted by the application in one place.
;           If you want the event to be sent into two targets at the same time
;           add a target with different name but same value.
;           For example if the log events need to go to local and remote files
;           in parallel you would create another target: logremote
;           and give it same value as log (which by convention is 4)



[dispatcher]
targets=debug, audit, log

; Inside section for each target the following parameters can be defined:
;
; value - (optional)
;         Stores the value associated with this target.
;         If the bit-wise AND of this value and the value provided by caller
;         of the interface is greater than 0 the event is logged into the
;         target destination. If omitted all events are sent to this target.
; sinks - (required)
;         Defines the list of the sink names that need to be loaded
;         each will have its own section.
;         Only one of the sinks is active - first in the list.
;         The list contains sinks in the fail over order.
;

[debug]
value = 1
sinks = debugfile, screen

[audit]
value = 2
sinks = auditfile, syslog

[log]
value = 4
sinks = logfile, syslog

; Each sink needs to have it's own section.
;
; COMMON FOR EVERY SINK
;
; provider - (required)
;            Defines the name of the sink or the special reserved word to
;            indicate that it is a sink provided by ELAPI library.
;
;            Special sinks provided by ELAPI are:
;             file
;             syslog
;
;            Example:
;            provider=file
;
;            this would mean the destination for this sink is a file.
;
;            If the sink is provided as an external plugin
;            the syntax should be the following:
;
;            provider=custom_audit
;
;            In this case the ELAPI will try to load shared library with the name
;            constructed using specified value. In the given example
;            ELAPI will try to load libelapi_sink_custom_audit.so library.
;            The general pattern is: libelapi_sink_<provider>.so
;
; required - (optional)
;            Defines whether it is a required sink?
;            If not present the dispatcher will return error at load time.
;
; onerror -  if the sink got an error what should dispatcher do?
;             0 - retry (default)
;             1 - disable
;
; timeout -  for how long one should wait before trying to revive the sink
;            default is 60 seconds
;
; synch -    yes/no (default no) - a flag that forces the sink to act synchronously
;                                  even if it can support async operations.
;            If application needs to have some events with guaranteed delivery
;            and wishes to block for those the implementation should
;            send such events to a special target that would consist
;            of the sinks that act in the synch mode and guarantee
;            the delivery or return failure.

; SPECIFIC CONFIGURATION PARAMETERS FOR DIFFERENT PROVIDERS
;
; 1) FILE PROVIDER
;
; filename - name of the log file. If not specified <appname>.log will be used.
;            Avoid using the same name of the file for different sinks,
;            the result might be unpredictable.
;            If file name is "stderr" the output will be sent to file descriptor 2.
;            If application closed file descriptor 2 the log attempt will
;            cause error and onerror value for the sink will be ignored.
;            The sink will be permanently disabled causing ELAPI to skip
;            it.
;            The "keepopen" and "fsyncmode" parameters are ignored for
;            "stderr" sink.
;
; keepopen - yes/no (default no) - keep file open
;
; outmode - 0 - CSV like (default)
;           1 - use format specifier
;           2 - HTML
;           3 - XML
;           4 - JSON
;           5 - key-value pairs
;
; set -     use only specific subset of fields in the given order
;           comma separated list of field names that are expected from
;           an event
;           The set can optionally end with an item:
;           @  - this would indicate that all the rest of the fields need to
;                be added at the end as separate fields.
;           @n - where n is one of the modes from "outmode" list.
;                in this case the all remaining fields will be jammed into one field
;                using specified format. In case of CSV jammed into CSV it is recommended
;                to use qualifier and set cvsescape to true
;           If the @ sign is absent only fields from the specified set will be
;           included into the output.
;           If event does not contain a specific field it will be empty in the output.
;
; fsyncmode - Defines if the data needs to be flushed to disk and how frequently
;             If this value is missing or 0 - no flushing.
;             If it is positive it denotes the number of events before next flush.
;             If it is negative it denotes the number of seconds before next flush.
;             Ignored if file is opened and closed each time.
;
; marker    - (optional)
;             Default is "\n".
;             Marker specifies a line that will be inserted into the file to denote
;             the beginning of a new run. The provided string is used as is
;             as a format argument for the strftime() function. The string can
;             contain zero or one time stamp format specifier listed in a man page
;             for the strftime function(). Providing an invalid marker can
;             potentially cause your application to crash.
;
;
; Format specific parameters:
;
; CSV related parameters (all optional):
;
; csvqual    - what to use as string qualifier for CSV outmode.
;              One character string.
;              If empty no qualifier is used.
;              If not specified then double quote is used.
; csvsep     - what to use as CSV field separator.
;              One character string.
;              If empty no separator is used.
;              If not specified comma is used.
; csvescsym  - which symbol to use as escape symbol.
;              One character string.
;              If empty or no qualifier no escaping is done.
;              If missing the "\" (backslash) is used.
;              Escaping is done only if both the qualifier
;              and the escape symbol are not empty.
; csvspace   - what to use as space after the separator. Default is space.
;              use "space" for space
;              use "tab" for tab
;              use "cr" for new line
;              Other value would cause an error.
; csvnumsp   - number of space characters to use. Default is 1.
; csvheader  - yes/no (default no). Include header into csv file.
;              Respected only if the "set" is explicitely defined.
;
;
; HTML related parameters
;
; htmlheader - create header row
;              ... TO BE Continued...

[debugfile]
provider=file
required=true
onerror=1
timeout=90

[logfile]
provider=file
required=true
onerror=0
timeout=60

[auditfile]
provider=file
required=true
onerror=1
timeout=90

[screen]
provider=file
filename=stderr
keepopen=false
synch=false
onerror=0
fsyncmode=-10
set=a, b, c, @0

[syslog]
provider=syslog
synch=yes