log4net - How to use ExtendedLog4netLogger.cs to set logfile path for appender at runtime? -


i trying figure out how use extendedlog4netlogger.cs change log file path dynamically @ runtime or using loggingfacility?

this should similar using log4net directly this:

log4net.globalcontext.properties["logname"] = logname; 

how access extendedlogger if register log4net integration this:

container.addfacility<loggingfacility>(f => f.uselog4net());

update: use following code register extended logger

container.addfacility<loggingfacility>(loggerimplementation.extendedlog4net).withconfig(configfile).tolog(lo‌gger)); 

i no runtime exceptions , logger not null instance don't see log file created @ using global properties, set config value appender:

<file type="log4net.util.patternstring" value="%property{logname}" />

if set file property in config file full path work. wondering if not working because configuration done before setting global variable.

extendedlogger.globalproperties["logname"] = logname; 

to enable extended logger need do:

container.addfacility<loggingfacility>(f => f.logusing(loggerimplementation.extendedlog4net)); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -