structuremap4 - Get context for log4net ILog with StructureMap? -
i'm trying inject log4net.ilog
interface classes replace typical method of
private readonly ilog logger = log4net.logmanager.getlogger(typeof(myclass));
i'm trying figure out way register ilog replicates above.
this question not duplicate of existing question: how output context class using log4net service?
as i'm using structuremap 4, , objectfactory gone , icontext interface seems have been simplified.
i can do
for<imyclass>().use(x => new myclass(logmanager.getlogger(typeof(myclass))));
but i'd configure ilog instead of needing logmanager, requires changing concrete type in 2 places
Comments
Post a Comment