Нет описания

LogFactory.cs 612B

12345678910111213141516171819202122232425
  1. using log4net;
  2. using System;
  3. using System.IO;
  4. using System.Web;
  5. namespace CallCenter.Utility
  6. {
  7. public class LogFactory
  8. {
  9. static LogFactory()
  10. {
  11. FileInfo configFile = new FileInfo(HttpContext.Current.Server.MapPath("/Configs/log4net.config"));
  12. log4net.Config.XmlConfigurator.Configure(configFile);
  13. }
  14. public static Log GetLogger(Type type)
  15. {
  16. return new Log(LogManager.GetLogger(type));
  17. }
  18. public static Log GetLogger(string str)
  19. {
  20. return new Log(LogManager.GetLogger(str));
  21. }
  22. }
  23. }