-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathLogMsgGroup.cs
More file actions
115 lines (93 loc) · 3.13 KB
/
LogMsgGroup.cs
File metadata and controls
115 lines (93 loc) · 3.13 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
using StackifyLib.Utils;
namespace StackifyLib.Models
{
public class LogMsgGroup
{
[JsonProperty]
public int? CDID { get; set; }
[JsonProperty]
public int? CDAppID { get; set; }
[JsonProperty]
public Guid? AppNameID { get; set; }
[JsonProperty]
public Guid? AppEnvID { get; set; }
[JsonProperty]
public short? EnvID { get; set; }
[JsonProperty]
public string Env { get; set; }
[JsonProperty]
public string ServerName { get; set; }
[JsonProperty]
public string AppName { get; set; }
[JsonProperty]
public string AppLoc { get; set; }
[JsonProperty]
public string Logger { get; set; }
[JsonProperty]
public string Platform { get; set; }
[JsonProperty]
public List<LogMsg> Msgs { get; set; }
public string GetUniqueKey()
{
return (Logger ?? "") + "" + ServerName + "-" + AppName + "-" + Env + "-" + (EnvID ?? 0) + "-" + (CDID ?? 0) + "-" +
(CDAppID ?? 0);
}
}
public class LogMsg
{
private static DateTime _Epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0);
public LogMsg()
{
EpochMs = (long)HighPrecisionTime.UtcNow.Subtract(_Epoch).TotalMilliseconds;
//Switched to high precision timer
//EpochMs = (long)DateTime.UtcNow.Subtract(_Epoch).TotalMilliseconds;
UploadErrors = 0;
}
[JsonIgnore]
public int UploadErrors { get; set; }
[JsonProperty]
public string Msg { get; set; }
[JsonProperty]
public string data { get; set; } //serialized object as json
[JsonProperty]
public StackifyError Ex { get; set; }
[JsonProperty]
public string Th { get; set; } //thread
[JsonProperty]
public string ThOs { get; set; } //OS thread number
[JsonProperty]
public string TransID { get; set; } //transaction ID
[JsonProperty]
public long EpochMs { get; set; }
[JsonProperty]
public string Level { get; set; }
[JsonProperty]
public string UrlRoute { get; set; }
[JsonProperty]
public string UrlFull { get; set; }
[JsonProperty]
public string SrcMethod { get; set; }
[JsonProperty]
public int? SrcLine { get; set; }
[JsonProperty]
public string id { get; set; } //unique id
[JsonProperty]
public List<string> Tags { get; set; }
[JsonProperty]
public int Order { get; set; }
[JsonIgnore]
public LogMsgGroup AppDetails { get; set; }
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.PreserveSig | MethodImplOptions.NoOptimization)]
public void SetLogMsgID(string id, int isError, string logLevel, string logMsg, string logData)
{
this.id = id;
}
}
}