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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -