Skip to content

Log Parameter Name mismatch in CachingAccessToken #355

@TsengSR

Description

@TsengSR

Affected component

Duende.AccessTokenManagement

Version

Duende.AccessTokenManagement 4.2.0

Describe the bug

Structured logs have a mismatch of variable name used in log string and the one set by the logger

Caching access token for client: iqars-client. Expiration: {Expiration}

Log shows Expiration but code sets CacheDuration.

state.TagArray[2] = new("{OriginalFormat}", "Caching access token for client: {ClientName}. Expiration: {Expiration}");
state.TagArray[1] = new("ClientName", clientName.ToString());
state.TagArray[0] = new("CacheDuration", cacheDuration);

It causes an ugly red markings in structured tools like seqlog

Image

Steps to reproduce

  1. Set up structural logging with Seq (or any logger, even console should do)
  2. Set up Duende.AccessTokenManagement
  3. Use the http client

Expected behavior

Expiraition being correctly logged in both log message and structured log as property.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions