Coder Social home page Coder Social logo

Comments (8)

saleem-mirza avatar saleem-mirza commented on August 11, 2024 1

MessageTemplate and EventIdHash exposed. Please see #38

@nblumhardt @martinstrimpfl

from serilog-sinks-azuredocumentdb.

saleem-mirza avatar saleem-mirza commented on August 11, 2024

@martinstrimpfl Sink is emitting rendered message instead of MessageTemplate. I believe a good message is better than cryptic template but if there is a better use case, it can be made part of log message in later releases.

from serilog-sinks-azuredocumentdb.

martinstrimpfl avatar martinstrimpfl commented on August 11, 2024

The reasons for the MessageTeplate field introduction are described here: https://nblumhardt.com/2014/09/how-not-to-parameterize-serilog-events/

IMHO it would be left to the user to decide whether to render the Message or to write the MessageTemplate or to use both.

Another option is to include a hash value of the template in the Properties.

from serilog-sinks-azuredocumentdb.

saleem-mirza avatar saleem-mirza commented on August 11, 2024

Under the hood, same good practiced is being followed except message rendering part. In practice I got mixed signals from end users asking where is message?

Initially, I was showing message template but people were asking what is this message? MessageTemplate": "The time is {Time},. Mostly there were expecting a complete message instead of template.

However, I'm still storing message properties as object for application or automated processing. Inclusion of Message Template as hash is an option too.

@nblumhardt your input please.

from serilog-sinks-azuredocumentdb.

martinstrimpfl avatar martinstrimpfl commented on August 11, 2024

IMHO the inclusion of the MT's hash would be a nice solution - it would keep the message readable when allowing the search for all the occurrences at the same time.

from serilog-sinks-azuredocumentdb.

nblumhardt avatar nblumhardt commented on August 11, 2024

πŸ‘ hash is a good "happy medium". There's a hash implementation in Serilog.Formatting.Compact that may be useful to copy in and use here - EventIdHash.cs.

from serilog-sinks-azuredocumentdb.

martinstrimpfl avatar martinstrimpfl commented on August 11, 2024

Is it possible to implement it? I've done it locally but I am not allowed to push my changes (in a branch) to the repo.

from serilog-sinks-azuredocumentdb.

saleem-mirza avatar saleem-mirza commented on August 11, 2024

Indeed its possible but will take some time before it make its way nuget.

from serilog-sinks-azuredocumentdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.