External configuration rules
Last updated
Last updated
Prerequisites:
Install
Read about
Read about
Read about
Read about
is essentially a with named components and for filtering and enrichment. Rules can be supplied from any external source and support reconfiguration without application restart.
Every rule contains some of the following:
Property
Type
Default value
Description
Enabled
bool
true
Enables/disables the logging in scope of the rule entirely.
Log
string
null
Limits the scope of the rule to the log with given name. If not specified, the rule applies to all logs.
Source
string
null
Operation
string
null
MinimumLevel
LogLevel?
null
Sets the minimum log level for the events in scope of the rule.
Properties
Dictionary
null
Adds given set of properties to every event in scope of the rule.
There are also some important points to remember when defining rules:
You should never create two rules with identical scopes (Log
+ Source
+ Operation
). Consider merging them instead.
Rules without Log
scope are evaluated before any log-specific rules are considered.
When evaluating whether to log an event, the most specific of the matching rules gets to decide.
A rule with Source
scope is more specific than a rule without any scope.
A rule with Operation
scope is more specific than a rule without any scope.
A rule with Operation
scope is more specific than a rule with Source
scope.
A rule with Source + Operation
scope is the most specific one possible.
Additional properties are added from all matching rules.
Limits the scope of the rule to events with having given prefix.
Limits the scope of the rule to events with having given prefix.
Rules can also be supplied with an IObservable<LogConfigurationRule[]>
. Here's an equivalent of the configuration above using library and storing rules in JSON file: