Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Enrich is not working #13

Open
donamk opened this issue Mar 20, 2017 · 6 comments
Open

Enrich is not working #13

donamk opened this issue Mar 20, 2017 · 6 comments

Comments

@donamk
Copy link

donamk commented Mar 20, 2017

Hello,

I have used following code for testing.
However, Logentires didn't capture the enrich machine name information.
logged "Test" only

LoggerConfiguration()
.MinimumLevel.Information()
.WriteTo.Logentries("token")
.Enrich.WithMachineName()
.CreateLogger();

Log.Information("Test");
@PureKrome
Copy link

@nblumhardt Hi Nick - I've just stumbled across a similar problem where i'm trying to encrich and it's not working.

I have done the following:

_logger = new LoggerConfiguration().ReadFrom.AppSettings()
    .Enrich.FromLogContext() // So we can dynamically add properties
    .WriteTo.Seq("http://localhost:5341")
    .CreateLogger()

appsettings.config

  <add key="serilog:minimum-level" value="Debug" />
  <add key="serilog:using" value="Serilog.Sinks.Logentries" />
  <add key="serilog:write-to:Logentries.token" value="<snipped>" />

Then some code...

using (LogContext.PushProperty("Query", query))
{
   ... lots of stuff ...
}

so I've:

  • Enabled both logentries and seq in my setup
  • Enabled enriching in setup.

tested app:

  • Encriching does go to Seq
  • Encriching does not goto LogEntries.

image

vs

image


So .. before I cry and ask for help ... only to get a 'soz, got more important things on my plate etc' (which i TOTALLY understand) .... Is there something I can further do to try and resolve this myself and offer up a PR?

Like ... for example ...

Is there some places I should look at and see what type of data is being passed down the wire or if some specific data is not getting set somewhere.

Even more higher level -> I'm assuming that LogEntries can accept this Structured Data!

So I'm here to help but I'm really not sure where to start etc.

@nblumhardt
Copy link
Contributor

At the moment, it doesn't look like anything is sent to LogEntries but the message:

https://github.com/serilog/serilog-sinks-logentries/blob/dev/src/Serilog.Sinks.Logentries/Sinks/Logentries/LogentriesSink.cs#L118

I'm not familiar enough with the API to know how to push properties through, but I assume LeClient will offer some clues. Can't dig in right now, but let me know if I can send any more info 👍

@PureKrome
Copy link

Ok - so the clue here is that I need to research how LE / LeClient handles properties. I'll see what I can also dig up and maybe post some answers/suggestions in here to (hopefully) help.

@PureKrome
Copy link

PureKrome commented Oct 26, 2017

@nblumhardt i'm just thinking about this problem again. Could it be solvable with using a JsonFormatter?

refs:

the idea being, the message is one KeyValue and each property is another KV and we just send some json message up to LogEntries.

@nblumhardt
Copy link
Contributor

@PureKrome sounds like the right kind of approach - not sure what the details will look like though (needs some investigation of the LE API).

@memark
Copy link

memark commented Feb 16, 2018

Just ran into this issue today. Has there been any progress?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants