using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using log4net.Config;
|
using log4net;
|
using System.Configuration;
|
|
namespace CY.WebService.Logging
|
{
|
/// <summary>
|
/// Log4日志具体实现
|
/// </summary>
|
public class Log4NetAdapter
|
{
|
private readonly log4net.ILog _log;
|
|
public Log4NetAdapter()
|
{
|
XmlConfigurator.Configure();
|
_log = LogManager.GetLogger("LogFileAppender");
|
}
|
|
public void Log(string message)
|
{
|
_log.Info(message);
|
}
|
|
public void Log(Exception ex)
|
{
|
_log.Error(ex.Message, ex);
|
}
|
}
|
}
|