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
  1. How-to guides

Using static log provider

PreviousUsing operation contextNextFiltering events

Last updated 6 years ago

Prerequisites: install .

Abstractions module contains a static class named LogProvider which serves as a global shared source of ILog instance.

It's intended use case is logging in libraries: library authors may not want to force their users to provide an ILog instance each time they're using library classes. Instead, these classes could just obtain a log from LogProvider:

LogProvider.Get().Info("library code message");

User application or underlying host may choose to explicitly configure LogProvider in order to enable this logging:

LogProvider.Configure(new ConsoleLog());

By default, Get method returns an instance of .

abstractions module
silent log