北鸣对接T+畅捷通,看板API
yl
2023-11-20 a3c4842af42b9c67a51340cb94c4e4534412bf1c
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
using log4net.Core;
using log4net.Layout.Pattern;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace VueWebApi.Log4net
{
    public class ActionConverter: PatternLayoutConverter
    {
        protected override void Convert(System.IO.TextWriter writer, LoggingEvent loggingEvent)
        {
            var actionInfo = loggingEvent.MessageObject as ActionLoggerInfo;
 
            if (actionInfo == null)
            {
                writer.Write("");
            }
            else
            {
                switch (this.Option.ToLower())
                {
                    case "op_type":
                        writer.Write(actionInfo.op_type);
                        break;
                    case "op_content":
                        writer.Write(actionInfo.op_content);
                        break;
                    case "actionclick":
                        writer.Write(actionInfo.actionclick);
                        break;
                    case "ippath":
                        writer.Write(actionInfo.ippath);
                        break;
                    case "lm_user":
                        writer.Write(actionInfo.lm_user);
                        break;
                    default:
                        writer.Write("");
                        break;
                }
            }
        }
    }
}