Closed stephenyeong closed 6 months ago
@stephenyeong To debug and possibly reproduce this, I will need some code that shows how you are initializing and using serilog -sinks-rabbitmq
@steffenlyng I store config in application.json and init serilog as below
application.json
"SerilogSinkRabbitMQ": {
"Hostnames": [ "192.168.4.129", "192.168.4.130" ],
"Username": "logger",
"Password": "**********",
"VHost": "logging",
"Exchange": "serilog-sink-exchange",
"ExchangeType": "topic",
"DeliveryMode": "Durable",
"RouteKey": "OAS",
"Port": 5672
},
Program.cs
var cfg = new ConfigurationBuilder()
.SetBasePath(dllpath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true).Build();
ApplicationSetting mysetting = cfg.GetSection("Application").Get<ApplicationSetting>();
RabbitMQClientConfiguration setting = cfg.GetSection("SerilogSinkRabbitMQ").Get<RabbitMQClientConfiguration>();
Log.Logger = new LoggerConfiguration().ReadFrom.Configuration(cfg)
.Enrich.WithMachineName()
.Enrich.FromLogContext()
.Enrich.WithProperty("Instance", mysetting.Instance)
.WriteTo.RabbitMQ((clientConfiguration, sinkConfiguration) =>
{
clientConfiguration.From(setting);
sinkConfiguration.TextFormatter = new Serilog.Formatting.Compact.CompactJsonFormatter();
sinkConfiguration.Period = TimeSpan.FromMilliseconds(500);
})
.CreateLogger();
Hello, is there any update on this?
@ArieGato I suggest to close this one as too old and due to lack of feedback.
I completly rewrote handling connections. I’m pretty sure this issue is fixed.
Describe the bug Compare with 3.0.3, 3.0.6 open too much RabbitMQ channel without close
To Reproduce In my case, When using Serilog.Sinks.RabbitMQ 3.0.3 only 1 channel on service startup. When using Serilog.Sinks.RabbitMQ 3.0.6 with 14 channels on service startup, and channel usage growth when rabbitmq connection not stable. Channel usage from 44 growth to 50 after RabbitMQ node failover.
Operating System and Software (please complete the following information):