A small NinjectModule
for Common.Logging.ILog
kernel.Load("*.dll");
or
kernel.Load(new Common.Logging.Ninject.NinjectModule());
Property Injection
[Inject] public Common.Logging.ILog CommonLogger { get; set; }
MVC Base Controller
using System.Web.Mvc; using Common.Logging; using Ninject; namespace YourWebApplication.Controllers { public class BaseController : Controller { [Inject] public ILog CommonLogger { get; set; } } }
Until you are using the Property Injection, the Logger Name equals to the Class Name of your Instance. If you use IKernel.Get<ILog>
, the Logger Name belongs to Settings.Default.DefaultLoggerName