38 lines
1.7 KiB
C#
38 lines
1.7 KiB
C#
|
// ********************************************************************************
|
|||
|
// 文件名字: LoggerService
|
|||
|
// 文件描述: LoggerService
|
|||
|
// 开发人员: Michael
|
|||
|
// 创建时间: 2019/11/8 0:08
|
|||
|
//
|
|||
|
// 更新历史:
|
|||
|
// + 创建 LoggerService.cs 文件. by Michael @2019/11/8 0:08
|
|||
|
// ********************************************************************************
|
|||
|
using log4net;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace Glorysoft.SECS.EQP.Utilities
|
|||
|
{
|
|||
|
public class LoggerService
|
|||
|
{
|
|||
|
public static ILog SECSLogger { get; private set; }
|
|||
|
public static ILog SYSLogger { get; private set; }
|
|||
|
public static ILog MQLogger { get; private set; }
|
|||
|
|
|||
|
public const string HtoE = "H=>E";
|
|||
|
public const string EtoH = "E=>H";
|
|||
|
public const string Receive = "Receive";
|
|||
|
public const string Send = "Send";
|
|||
|
|
|||
|
|
|||
|
static LoggerService()
|
|||
|
{
|
|||
|
var sPath = string.Concat(AppDomain.CurrentDomain.BaseDirectory, @"\logs");
|
|||
|
LogManager.ConfigureLogger(nameof(SYSLogger), sPath, eLogFilter.DEBUG, eLogFilter.DEBUG | eLogFilter.INFO | eLogFilter.ERROR | eLogFilter.WARN, eFileFomart.Date, null);
|
|||
|
LogManager.ConfigureLogger(nameof(SECSLogger), sPath, eLogFilter.DEBUG, eLogFilter.DEBUG | eLogFilter.INFO | eLogFilter.ERROR | eLogFilter.WARN, eFileFomart.Date, null);
|
|||
|
LogManager.ConfigureLogger(nameof(MQLogger), sPath, eLogFilter.DEBUG, eLogFilter.DEBUG | eLogFilter.INFO | eLogFilter.ERROR | eLogFilter.WARN, eFileFomart.Date, null);
|
|||
|
SYSLogger = LogManager.GetConfigureLogger(nameof(SYSLogger));
|
|||
|
SECSLogger = LogManager.GetConfigureLogger(nameof(SECSLogger));
|
|||
|
MQLogger = LogManager.GetConfigureLogger(nameof(MQLogger));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|