Skip to content

improvement: remove key sanitization #49

@vmandic

Description

@vmandic

Hi, I have a log4net context propety like 'X-SomeName-Something', it gets pushed to SEQ with SeqAppender but in SEQ it appears in properties with a different name, ie. without the dashes like XSomeNameSomething? Is this by design or a bug, is there a way I can force this to go as intented with dashes so I can query @Properties["X-SomeName-Something"] = 'lorem12345'

I use this within a .NET48 MVC webapp on Log4Net 2.0.14, the SeqAppender is <package id="Seq.Client.Log4Net" version="3.1.0" targetFramework="net48" /> and I async buffer it with <appender name="SeqAsyncForwarder" type="Easy.Logger.AsyncBufferingForwardingAppender, Easy.Logger">.

Problematic code sample:

// inside Global.asax > private void App_BeginRequest(object sender, EventArgs e) { ... }

var correlationid = Guid.NewGuid().ToString();
LogicalThreadContext.Properties["X-Some-CorrelationId"] = correlationid;
ThreadContext.Properties["X-Some-CorrelationId"] = correlationid;

Shows up in SEQ log as:
image

So its missing the two dashes in the property name. Any ideas, is this related to this lib? Thanks.

EDIT

I am looking at: https://github.com/datalust/seq-client-log4net/blob/dev/src/Seq.Client.Log4Net/Client/Log4Net/LoggingEventFormatter.cs and I guess it might be to some code in it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions