32 lines
841 B
C#
32 lines
841 B
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace LogServer
|
|||
|
|
{
|
|||
|
|
/// <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);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|