Custom filename in a rolling Log4Net logfile?

后端 未结 6 1631
刺人心
刺人心 2020-12-24 07:50

We have a ASP .Net application whereby we use Log4Net to log details within the app - nothing new there - and the rolling log filenames are in the usual format of:



        
6条回答
  •  猫巷女王i
    2020-12-24 08:35

    look for log4net Context Properties...

    in your code :

    log4net.GlobalContext.Properties["id"] = "12345";
    

    then

    log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo("configPath"));
    

    in the log4net config file:

    
    

提交回复
热议问题