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.
The NuGet package:
PM> Install-Package TacitusLogger.DI.Ninject
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>();
TacitusLogger:
- TacitusLogger - A simple yet powerful .NET logging library.
Destinations:
- TacitusLogger.Destinations.MongoDb - Extension destination for TacitusLogger that sends logs to MongoDb database.
- TacitusLogger.Destinations.RabbitMq - Extension destination for TacitusLogger that sends logs to the RabbitMQ exchanges.
- TacitusLogger.Destinations.Email - Extension destination for TacitusLogger that sends logs as emails using SMTP protocol.
- TacitusLogger.Destinations.EntityFramework - Extension destination for TacitusLogger that sends logs to database using Entity Framework ORM.
- TacitusLogger.Destinations.Trace - Extension destination for TacitusLogger that sends logs to System.Diagnostics.Trace listeners.
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:
- TacitusLogger.Contributors.ThreadInfo - Extension contributor for TacitusLogger that generates additional info related to the thread on which the logger method was called.
- TacitusLogger.Contributors.MachineInfo - Extension contributor for TacitusLogger that generates additional info related to the machine on which the log was produced.