-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
26 lines (23 loc) · 969 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.IO;
using System.Reflection;
using log4net;
using log4net.Config;
using log4net.Repository;
namespace Log4NetImplementationInDotNetCore
{
class Program
{
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
static void Main(string[] args)
{
ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
log.Info("If you see this, it means that log4net is working.");
log.Debug("If you see this, it means that log4net is working.");
log.Warn("If you see this, it means that log4net is working.");
log.Error("If you see this, it means that log4net is working.");
log.Fatal("If you see this, it means that log4net is working.");
}
}
}