Skip to content

Commit e6843e4

Browse files
committed
Update demo client
1 parent b3fcf6e commit e6843e4

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

example/Demo/Demo.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Serilog" Version="2.8.0" />
10-
<PackageReference Include="Serilog.Sinks.RabbitMQ" Version="2.0.2" />
11-
<PackageReference Include="Serilog.Formatting.Compact" Version="1.0.0" />
9+
<PackageReference Include="Serilog" Version="4.3.0" />
10+
<PackageReference Include="Serilog.Sinks.RabbitMQ" Version="8.0.0" />
11+
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
1212
</ItemGroup>
1313

1414
</Project>

example/Demo/Program.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
using System.Threading;
22
using Serilog;
33
using Serilog.Formatting.Compact;
4-
using Serilog.Sinks.RabbitMQ.Sinks.RabbitMQ;
5-
6-
var rmq = new RabbitMQConfiguration
7-
{
8-
Hostname = "localhost",
9-
Username = "guest",
10-
Password = "guest",
11-
Exchange = "",
12-
RouteKey = "logs"
13-
};
144

155
Log.Logger = new LoggerConfiguration()
166
.Enrich.WithProperty("Application", "Demo")
17-
.WriteTo.RabbitMQ(rmq, new CompactJsonFormatter())
7+
.WriteTo.RabbitMQ((client, sink) =>
8+
{
9+
client.Hostnames.Add("localhost");
10+
client.Username = "guest";
11+
client.Password = "guest";
12+
client.Exchange = "";
13+
client.RoutingKey = "logs";
14+
sink.TextFormatter = new CompactJsonFormatter();
15+
})
1816
.CreateLogger();
1917

2018
while (true)

0 commit comments

Comments
 (0)