Files
BeWoPlaner/Server/Components/ServerUtils/Core/LoggerUtils.cs

31 lines
622 B
C#

using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.ServerUtils.Core
{
public static class LoggerUtils
{
private static bool _LoggerInit = false;
public static void InitLogger()
{
if (_LoggerInit) return;
log4net.Config.XmlConfigurator.Configure();
_LoggerInit = true;
}
public static ILog GetLogger(Type declaringType)
{
InitLogger();
return log4net.LogManager.GetLogger(declaringType);
}
}
}