星火微课系统客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

LogHelper.cs 739B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using log4net;
  6. namespace Common.system
  7. {
  8. public class LogHelper
  9. {
  10. public static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo");
  11. public static readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror");
  12. public static void WriteInfoLog(string info)
  13. {
  14. if (loginfo.IsInfoEnabled)
  15. {
  16. loginfo.Info(info);
  17. }
  18. }
  19. public static void WriteErrLog(string info, Exception ex)
  20. {
  21. if (logerror.IsErrorEnabled)
  22. {
  23. logerror.Error(info, ex);
  24. }
  25. }
  26. }
  27. }