I need to change the log file path to a custom path.
I have a code where it makes the file in the wwwroot folder.
public static ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected void Application_Start(object sender, EventArgs e)
{
log4net.Config.XmlConfigurator.Configure();
FileAppender rootAppender = (FileAppender)((log4net.Repository.Hierarchy.Hierarchy)LogManager.GetRepository()).Root.Appenders[0];
string filename = rootAppender.File;
Global.logger.Error("Log 4 net filename: " + filename);
}
please can some1 help me with this.
Thanks
This is what is there in my config file.
<!-- Log file locaation -->
<param name='File' value='TS_GUI_Logs.coplog'/>
<param name='AppendToFile' value='true'/>
I do not want to set the File name in the config. Instead i want to set it from my code behind.