Vostok.Logging
HomeQuickstartModulesImplementations
1.0.0
1.0.0
  • Home
  • Quickstart
  • Guarantees
  • Configuration
  • Concepts and basics
    • Log interface
    • Log events
    • Syntax
      • Logging extensions
      • Message templates
      • Providing property values
    • Formatting
      • Output templates
      • Special properties
      • Format specifiers
    • Source context
    • Operation context
  • Modules
    • Abstractions
    • Configuration
    • Formatting
    • Console
    • File
    • Hercules
    • Context
    • Serilog
    • Log4net
    • NUnit
    • Microsoft
  • Implementations
    • Silent log
    • Console log
    • File log
    • Hercules log
  • Integrations
    • Serilog integration
    • Log4net integration
    • Microsoft logging integration
  • How-to guides
    • Using operation context
    • Using static log provider
    • Filtering events
    • Enriching events
    • Transforming events
    • Combining multiple logs
    • Custom output templates
    • External configuration rules
Powered by GitBook
On this page
  • Structure
  • Immutability
  1. Concepts and basics

Log events

PreviousLog interfaceNextSyntax

Last updated 6 years ago

is the atomic unit of logging data: every act of logging produces one.

Users are typically not required to create log events manually as numerous handle event construction, unless they are building a custom log implementation/decorator.

Structure

Every log event consists of five components:

  • Level

    • Levels indicate event severity:

      • Debug: verbose output, typically disabled in production

      • Info: neutral messages

      • Warn: non-critical errors that don't affect the normal operation of the application

      • Error: unexpected errors that may require human attention

      • Fatal: critical errors resulting in application shutdown

  • Timestamp

    • Timestamp of the event creation. Includes timezone information.

  • Message template

    • of the log message that may contain placeholders to be filled with values from properties. May be absent in a valid log event.

  • Properties

    • Arbitrary key-value data with case-sensitive string keys. May be absent in a valid log event.

  • Exception

    • The error associated with the log event. May be absent in a valid log event.

Immutability

Log events are effectively immutable: any changes lead to creation of a new event. LogEvent class provides a set of special transformation methods:

logEvent = logEvent.WithProperty("Count", 100);
logEvent = logEvent.WithoutProperty("UselessProperty");

This ensures thread safety when routing the same event to multiple logs.

Log event
logging extensions
Template