How to enable logging using Ninject?

Is there a way to get Ninject to exit what it does?

In particular, I would like to see when objects are created. Since I have a combination of transitional and singleton objects, it would be very useful for me during debugging to see how many instances of each are created so that I can correct the areas of objects where necessary.

EDIT: NB I look at Ninject 2 as at http://github.com/ninject/ninject

+3
source share
2 answers

v1.x answer: Yes, through log adapters for ao log4net and NLog - see http://mhinze.com/logging-with-ninject/

[ ] EDIT: v2.0 -: : -

Ninject 2 -!

, Ninject 1.x, Ninject 2:

. , . Ninject , Im .

...

+1

-, . 2.0 RTM , , . , - .OnActivation(... ) .

+2

Source: https://habr.com/ru/post/1725613/


All Articles