季铭对接T+畅捷通,看板API
yl
2023-12-25 72a27b4fd84622ebc51150a07b16d13b7135ebf9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace VueWebApi.Log4net
{
    public class LogUtil
    {
        public LogUtil() { }
        private static ActionLoggerInfo _message = null;
        private static log4net.ILog _log;
        public static log4net.ILog Log
        {
            get
            {
                if (_log == null)
                {
                    _log = LogManager.GetLogger("OperateLogger");
                }
                return _log;
            }
        }
        public static void Debug()
        {
            if (Log.IsDebugEnabled)
            {
                Log.Debug(_message);
            }
        }
        public static void Error()
        {
            if (Log.IsErrorEnabled)
            {
                Log.Error(_message);
            }
        }
        public static void Fatal()
        {
            if (Log.IsFatalEnabled)
            {
                Log.Fatal(_message);
            }
        }
        public static void Info()
        {
            if (Log.IsInfoEnabled)
            {
                Log.Info(_message);
            }
        }
        public static void Warn()
        {
            if (Log.IsWarnEnabled)
            {
                Log.Warn(_message);
            }
        }
 
        /// <summary>
        /// 操作记录调用方法
        /// </summary>
        /// <param name="op_type">操作类型</param>
        /// <param name="op_content">操作类容</param>
        /// <param name="actionclick">操作方法</param>
        /// <param name="ippath">ip地址</param>
        /// <param name="lm_user">操作人员</param>
        public static void SaveMessage(string op_type, string op_content, string actionclick,string ippath,string lm_user, int level)
        {
            _message = new ActionLoggerInfo(op_type, op_content, actionclick, ippath, lm_user, level);
            switch (level)
            {
                case 1: Info(); break;
                case 2: Warn(); break;
                case 3: Error(); break;
                case 4: Fatal(); break;
                default: break;
            }
        }
    }
}