How to feed logs to RabbitMQ
Introduction
Identify logging framework already supports two common stores: Flat File, Serilog Sinks. In the Serilog Sinks mode, we supported SQL Server and RabbitMQ. This guideline is for how to configure Identify logging to RabbitMQ then later they could be fed to Cosmos DB or others that support importing log from RabbitMQ (or other AMQP-compliant queues too).
Implementation
We only need to do two steps to feed logs to existing RabbitMQ. Download binaries here and copy to bin folder of both Runtime and Admin folder of Identify. Update those configuration keys in Web.config of Runtime and Admin folder of Identify
<add key="serilog:minimum-level" value="Verbose" />
<add key="serilog:using:RabbitMQ" value="Serilog.Sinks.RabbitMQ" />
<add key="serilog:write-to:RabbitMQ.hostname" value="rabbit.safewhere.local"/>
<add key="serilog:write-to:RabbitMQ.username" value="guest"/>
<add key="serilog:write-to:RabbitMQ.password" value="guest"/>
<add key="serilog:write-to:RabbitMQ.exchange" value="identify"/>
<add key="serilog:write-to:RabbitMQ.filterPropertyName" value="Type"/>
<add key="serilog:write-to:RabbitMQ.filterPropertyValue" value="REV"/>
The filterPropertyValue is the feeding filter. If the value is empty, it will mean that all log types are shipped. Otherwise, only selected log types are shipped.
Important: the serilog:minimum-level here is Serilog setting purely. It is not logging level of Identify. Recommended value is Verbose which indicates that all logging levels of Identify will be shipped. We can still be able to control logging level of Identify as usual in System Setup.