You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
624 B
32 lines
624 B
using log4net;
|
|
using System.IO;
|
|
|
|
namespace EC.Utils
|
|
{
|
|
/// <summary>
|
|
/// LogFactory
|
|
/// 版 本:V3.0.0
|
|
/// 版 权:EasyCode
|
|
/// 作 者:LXC
|
|
/// </summary>
|
|
public class LogFactory
|
|
{
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
static LogFactory()
|
|
{
|
|
var repository = LogManager.CreateRepository("ExceptionEx");
|
|
log4net.Config.XmlConfigurator.Configure(repository, new FileInfo("log4.config"));
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取日志操作对象
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static Log GetLogger()
|
|
{
|
|
return new Log(LogManager.GetLogger("ExceptionEx", ""));
|
|
}
|
|
}
|
|
}
|