28 lines
891 B
C#
28 lines
891 B
C#
using log4net.Config;
|
|
using log4net;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Epi2Exchange2
|
|
{
|
|
public static class Logger
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
static Logger()
|
|
{
|
|
var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
|
|
XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
|
|
}
|
|
|
|
public static void Info(string message) => log.Info(message);
|
|
public static void Warn(string message) => log.Warn(message);
|
|
public static void Error(string message, Exception ex = null) => log.Error(message, ex);
|
|
public static void Debug(string message) => log.Debug(message);
|
|
}
|
|
}
|