log4net - How to check whether the log is enabled or disabled? -
i trying check whether log enabled or disabled based on ini file. have check condition every time whether enabled or disabled. have check log file enabled or disabled once , use everywhere. how can this?
if ("true".equals(m_objglobalconfig.soaplog)) { log.errorformat(se.message + environment.newline + environment.newline, se.stacktrace); }
is there can customization appender ?
you disable log4net initialization based on parameter, prevent log4net being configured , logging:
during initialization of program :
if ("true".equals(m_objglobalconfig.soaplog)) { log4net.config.xmlconfigurator.configureandwatch(new system.io.fileinfo("path/to/file")); }
and can log normally
Comments
Post a Comment