初始化项目
This commit is contained in:
31
AUTS.Log4Net/ExceptionLogHelper.cs
Normal file
31
AUTS.Log4Net/ExceptionLogHelper.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user