mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 18:20:11 +00:00
Updates to Elastic logging
This commit is contained in:
parent
ae9ed0f4ee
commit
ae82bb4168
18 changed files with 150 additions and 97 deletions
|
|
@ -9,6 +9,7 @@ using Myriad.Serialization;
|
|||
using Myriad.Types;
|
||||
|
||||
using Serilog;
|
||||
using Serilog.Context;
|
||||
|
||||
namespace Myriad.Gateway
|
||||
{
|
||||
|
|
@ -50,7 +51,7 @@ namespace Myriad.Gateway
|
|||
_info = info;
|
||||
_ratelimiter = ratelimiter;
|
||||
_url = url;
|
||||
_logger = logger;
|
||||
_logger = logger.ForContext<Shard>().ForContext("ShardId", info.ShardId);
|
||||
_stateManager = new ShardStateManager(info, _jsonSerializerOptions, logger)
|
||||
{
|
||||
HandleEvent = HandleEvent,
|
||||
|
|
@ -70,6 +71,9 @@ namespace Myriad.Gateway
|
|||
|
||||
private async Task ShardLoop()
|
||||
{
|
||||
// may be superfluous but this adds shard id to ambient context which is nice
|
||||
using var _ = LogContext.PushProperty("ShardId", _info.ShardId);
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue