Add persistent event ID to log context
This commit is contained in:
parent
ca4ffdb803
commit
e556cc71fa
@ -102,12 +102,13 @@ namespace PluralKit.Bot
|
|||||||
|
|
||||||
async Task HandleEventInner()
|
async Task HandleEventInner()
|
||||||
{
|
{
|
||||||
|
using var _ = LogContext.PushProperty("EventId", Guid.NewGuid());
|
||||||
|
|
||||||
// Mainly for testing ELK volume atm, no-op unless Elastic is configured
|
// Mainly for testing ELK volume atm, no-op unless Elastic is configured
|
||||||
if (evt is MessageCreateEventArgs mc)
|
if (evt is MessageCreateEventArgs mc)
|
||||||
using (LogContext.PushProperty("Elastic", "yes?"))
|
using (LogContext.PushProperty("Elastic", "yes?"))
|
||||||
_logger.Information("Received event {@Event}", new
|
_logger.Information("Received event {@Event}", new
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
|
||||||
Type = mc.GetType().Name.Replace("EventArgs", ""),
|
Type = mc.GetType().Name.Replace("EventArgs", ""),
|
||||||
MessageId = mc.Message.Id,
|
MessageId = mc.Message.Id,
|
||||||
ChannelId = mc.Channel.Id,
|
ChannelId = mc.Channel.Id,
|
||||||
|
Loading…
Reference in New Issue
Block a user