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
Logs the given LogEvent
. Read more about extensions here.
IsEnabledFor
Returns whether the current log is configured to log events of the given LogLevel
.
ForContext
Returns a copy of the log operating in the given source context. For details, see Advanced usage.
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.
Last updated