-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUsage.cs
More file actions
25 lines (22 loc) · 728 Bytes
/
Usage.cs
File metadata and controls
25 lines (22 loc) · 728 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
using Microsoft.Extensions.Logging;
using NServiceBus.Logging;
using Microsoft.Extensions.DependencyInjection;
using MsLogLevel = Microsoft.Extensions.Logging.LogLevel;
class Usage
{
Usage()
{
#region MsLoggingInCode
var serviceCollection = new ServiceCollection();
serviceCollection.AddLogging(loggingBuilder =>
{
loggingBuilder.AddFilter(level => level >= MsLogLevel.Information);
loggingBuilder.AddConsole();
});
using var loggerFactory = new LoggerFactory();
var logFactory = LogManager.Use<MicrosoftLogFactory>();
logFactory.UseMsFactory(loggerFactory);
// endpoint startup and shutdown
#endregion
}
}