星火微课系统客户端
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.

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. }