Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 3.4 KB

README.md

File metadata and controls

76 lines (54 loc) · 3.4 KB

TacitusLogger.DI.Ninject

Extension for Ninject dependency injection container that helps to configure and add TacitusLogger as a singleton.

Dependencies:

  • NET Standard >= 2.0
  • Ninject >= 3.3.0
  • TacitusLogger >= 0.3.0

Attention: TacitusLogger.DI.Ninject is currently in Alpha phase. This means you should not use it in any production code.

Installation

The NuGet package:

PM> Install-Package TacitusLogger.DI.Ninject

Examples

IKernel kernel = new StandardKernel();
// Registering TacitusLogger with Ninject as a singleton.
kernel.TacitusLogger("logger1").ForAllLogs()
                               .Console()
                               .Add()
                               .BuildLogger();
// Resolving the dependency
ILogger logger = kernel.Get<ILogger>();

Or:

IKernel kernel = new StandardKernel();
// Registering TacitusLogger with Ninject as a singleton.
var loggerBuilder = kernel.TacitusLogger("logger1");
loggerBuilder.ForAllLogs()
             .Console()
             .Add()
             .BuildLogger();

// Resolving the dependency
ILogger logger = kernel.Get<ILogger>();

License

APACHE LICENSE 2.0

See also

TacitusLogger:

Destinations:

Dependency injection:

  • TacitusLogger.DI.Autofac - Extension for Autofac dependency injection container that helps to configure and add TacitusLogger as a singleton.
  • TacitusLogger.DI.MicrosoftDI - Extension for Microsoft dependency injection container that helps to configure and add TacitusLogger as a singleton.

Log contributors: