using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LogServer
{
public class Log4NetHelper
{
///
/// 写log
///
///
public static void Log(string logMessage)
{
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
if (log.IsInfoEnabled)
{
log.Info(logMessage);
}
}
///
/// debug
///
///
public static void Debug(string logMessage)
{
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
if (log.IsInfoEnabled)
{
log.Info(logMessage);
}
}
///
/// debug
///
/// 消息
/// 异常
public static void Debug(string logMessage, Exception ex)
{
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
if (log.IsInfoEnabled)
{
log.Error(logMessage, ex);
}
}
///
/// log
///
/// 消息
/// 异常
public static void Log(string logMessage, Exception ex)
{
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
if (log.IsInfoEnabled)
{
log.Error(logMessage, ex);
}
}
}
}