0

I want to put log messages to console and part of UI of my app simultaneously. But i cant find a way to do it with ninject.

I have a logger injected by ninject, and it perfectly make output to console and custom target. But I can't subscribe target to event broker because target initialization was outside ninject life-cycle.

Can anyone make some advice with this? How i can display logs in my UI?

Julian
  • 33,915
  • 22
  • 119
  • 174
daspisch
  • 13
  • 3

1 Answers1

0

Thanks to BatteryBackupUnit i found how to resolve this situation. First of all We need to inject logs target to kernel kernel.Bind<IMyTarget>().To<MyTarget>(); And then make a custom instantiation method NLog.Config.ConfigurationItemFactory.Default.CreateInstance = (type) => kernel.TryGet(type);

daspisch
  • 13
  • 3