Skip to content

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

License

Notifications You must be signed in to change notification settings

hanlarmammadov/TacitusLogger.DI.Ninject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages