Basics
This page includes the basic concepts of Vostok.Logging
The main interface, represents a log.
There are two standard log implementations in Vostok, developers use ILog
to write their own implementations.
ILog
has three methods:
Method
Description
Log
IsEnabledFor
Returns whether the current log is configured to log events of the given LogLevel
.
ForContext
Event consists of a level, a timestamp, a log message, a saved exception and user-defined properties.
Level One of five level of the event:
Debug For verbose output.
Info For neutral messages.
Warn For non-critical errors that don't interrupt the normal operation of the application.
Error For unexpected errors that may require human attention.
Fatal For critical errors that result in application shutdown.
Timestamp Represents the time when the event was created.
Message template The template of the log message containing placeholders to be filled with values from. A few examples can be found here.
Properties Contains various user-defined properties of the event.
Exception The error associated with this log event.
You don't need to create LogEvent yourself, extensions do it for you.
Learn more about how to use extension syntax here.
Last updated