public void LogEventHandler(EventHandlerRecord record)
{
try
{
var handlerDoc = EventHandlerRecord.ToBson(record);
var query = Query.And(
Query.EQ("_id", record.CommandId),
Query.EQ("Events.Event.Metadata.EventId", record.EventId)
);
var update = Update.Push("Events.$.Handlers", handlerDoc);
Write.Logs.Update(query, update);
}
catch(Exception e)
{
// Catch all errors because logging should not throw errors if unsuccessful
}
}