forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsingLog4Net.cs
More file actions
31 lines (27 loc) · 792 Bytes
/
Copy pathUsingLog4Net.cs
File metadata and controls
31 lines (27 loc) · 792 Bytes
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
27
28
29
30
31
using ServiceStack.Logging.Log4Net;
using NUnit.Framework;
namespace ServiceStack.Logging.Tests.UseCases
{
[TestFixture]
public class UsingLog4Net
{
[Test]
public void Log4NetUseCase()
{
LogManager.LogFactory = new Log4NetFactory();
ILog log = LogManager.GetLogger(GetType());
log.Debug("Debug Event Log Entry.");
log.Warn("Warning Event Log Entry.");
}
[Test]
public void Log4NetUseCasePushProperty()
{
LogManager.LogFactory = new Log4NetFactory();
ILog log = LogManager.GetLogger(GetType());
using (log.PushProperty("Hello", "World"))
{
log.Warn("Warning Event Log Entry.");
}
}
}
}