爱思开
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
604 B

2 years ago
  1. using log4net;
  2. using System;
  3. using System.IO;
  4. using System.Web;
  5. namespace NFine.Code
  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. }