Configuration
Last updated
Last updated
This page describes approaches to configuration employed in Vostok.Logging.
There's no such thing as a log factory or log provider: there are just instances, and the only way to get one initially is to instantiate one of the available in code. Everything else is achieved with decorator-based extensions and interface methods:
multiple logs into one.
incoming events.
incoming events with properties.
Obtaining log instances tied to specific .
This approach may look unfamiliar to prior users experienced with . Indeed, it lacks additional flexibility offered by file-based configs but enables much easier setup for new applications.
It's preferable to inject log instances explicitly through constructors, either using a DI container or simply passing them manually. may be sufficient for simple applications, though.
Individual log instances (such as or ) are typically configured in code by passing a settings object. However, some implementations (namely ) also accept an arbitrary settings provider delegate that can be used to configure from external sources using library.
Also, simple filtering and enrichment rules can be supplied from .