c# - log4net for IIS WCF service with separate config -


i want use log4net wcf service hosted in iis.

but change settings easily, want use separate config file.

so added web.config (and app.config of wcf service library)

<appsettings>     <add key="log4net_config" value="log4net.config" /> </appsettings> 

but leads current directory of iis, is

c:\windows\system32\inetsrv 

and there never log4net.config file.

but want configure log4net like

var configfile = configurationmanager.appsettings["log4net_config"]; var fileinfo = new fileinfo(configfile); xmlconfigurator.configureandwatch(fileinfo); 

how can configure directory fits needs?

first of put full path log4.net config file.

secondly can use system.web.hosting.hostingenvironment.mappath example resolve path "~/log4net.config"


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -