Describe the Bug
Custom log attributes scope are not preserved after awaiting promise.
To Reproduce
Steps to reproduce the behavior:
Use this code:
[ClientCallable]
public async Promise<int> Asddd(int a, int b)
{
try
{
using var _ = Log.Default.BeginScope(new Dictionary<string, object>
{
["battleType"] = "DSADAS",
});
Log.Information("REQUEST: Creating a single match from player new");
Log.Information("REQUEST: Creating a single match from player2 new");
var ss = Context.BeamContext;
var userAuth = await Services.Auth.GetUser(Context.AccountId).Recover(_ => new User(){id = -1});
Log.Information("Creating a single match from player {playerId}", userAuth.id);
return a;
}
catch (Exception ex)
{
Log.Error(ex, "Received exception while ");
throw;
}
}
Expected Behavior
All three logs would have battleType stored in log on portal.
Actual Behavior
battleType is preserved only in first two logs, last one after awaiting call to Services no longer contains that attribute in log.
Screenshots
Metadata
- SDK version: latest
- Engine version: n/a
- Operating System: all
Describe the Bug
Custom log attributes scope are not preserved after awaiting promise.
To Reproduce
Steps to reproduce the behavior:
Use this code:
Expected Behavior
All three logs would have
battleTypestored in log on portal.Actual Behavior
battleTypeis preserved only in first two logs, last one after awaiting call to Services no longer contains that attribute in log.Screenshots
Metadata