Files
Web_AUTSDATA_Mvc_Prod/AUTS.Log4Net/ExceptionLogHelper.cs

32 lines
844 B
C#
Raw Normal View History

2025-11-20 13:11:05 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Log4Net
{
/// <summary>
/// 一般操作产生的日志
/// </summary>
public class ExceptionLogHelper
{
public static void Log(ExceptionLogMessage logMessage)
{
var log = LoggerFactory.CreateInstance(Log4NetType.Exception.ToString());
if (log.IsErrorEnabled)
{
log.Error(logMessage);
}
}
public static void Log(ExceptionLogMessage logMessage, Exception exception)
{
var log = LoggerFactory.CreateInstance(Log4NetType.Exception.ToString());
if (log.IsErrorEnabled)
{
log.Error(logMessage, exception);
}
}
}
}