:zap:优化Nlog日志记录,解决记录到文本IP、请求地址获取不到问题
This commit is contained in:
@@ -5,9 +5,19 @@ namespace Infrastructure
|
||||
public class CustomException : Exception
|
||||
{
|
||||
public int Code { get; set; }
|
||||
/// <summary>
|
||||
/// 前端提示语
|
||||
/// </summary>
|
||||
public string Msg { get; set; }
|
||||
/// <summary>
|
||||
/// 记录到日志的详细内容
|
||||
/// </summary>
|
||||
public string LogMsg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否通知
|
||||
/// </summary>
|
||||
public bool Notice { get; set; } = true;
|
||||
|
||||
public CustomException(string msg) : base(msg)
|
||||
{
|
||||
}
|
||||
@@ -17,9 +27,10 @@ namespace Infrastructure
|
||||
Msg = msg;
|
||||
}
|
||||
|
||||
public CustomException(ResultCode resultCode, string msg) : base(msg)
|
||||
public CustomException(ResultCode resultCode, string msg, bool notice = true) : base(msg)
|
||||
{
|
||||
Code = (int)resultCode;
|
||||
Notice = notice;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user