Code Monkey home page Code Monkey logo

Comments (9)

pysco68 avatar pysco68 commented on May 26, 2024

Hello Tim,

the signature of WriteCore() is actually defined in Microsoft.Owin.Logging.ILogger. That's why there's that "eventId" parameter. We're currently not using it as you stated, but if you can tell us a requirement or use case I'll look into it.

from nlog.owin.logging.

pysco68 avatar pysco68 commented on May 26, 2024

Btw. I can't actually even find any information about the meaning of the eventId parameter (there's nothing written about it in the doc at least, and I found a couple of ILogger implementations not using it either or having funny TODO comments for the matter).

from nlog.owin.logging.

t-smirnov avatar t-smirnov commented on May 26, 2024

@pysco68 So, there is one way to do with

public bool WriteCore(TraceEventType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
            {
                var logLevel = _getLogLevel(eventType);
                if (state == null)
                {
                    return _nlogger.IsEnabled(logLevel);
                }
                if (!_nlogger.IsEnabled(logLevel))
                {
                    return false;
                }

                var logEvent = NLog.LogEventInfo.Create(logLevel, _nlogger.Name, exception, _nlogger.Factory.DefaultCultureInfo, formatter(state, exception));
                logEvent.Properties[EvnetIdKey] = eventId;

                _nlogger.Log(logEvent);

                return true;
            }

Why you dont using LogEventInfo?

from nlog.owin.logging.

pysco68 avatar pysco68 commented on May 26, 2024

That looks okay to me. Can you provide me some information about the meaning of the eventId?
I'd like to write that down somewhere so that it is publicly known that it's actually there...

from nlog.owin.logging.

t-smirnov avatar t-smirnov commented on May 26, 2024

@pysco68 EventId is identifier for logs written to Windows eventlog, providing easy monitoring etc.

from nlog.owin.logging.

304NotModified avatar 304NotModified commented on May 26, 2024

fixed in #17

from nlog.owin.logging.

304NotModified avatar 304NotModified commented on May 26, 2024

Will be released as 1.1. Thanks for reporting, @pysco68 thanks for fixing!

from nlog.owin.logging.

304NotModified avatar 304NotModified commented on May 26, 2024

https://www.nuget.org/packages/NLog.Owin.Logging/1.1.0

from nlog.owin.logging.

t-smirnov avatar t-smirnov commented on May 26, 2024

@304NotModified nice, ty

from nlog.owin.logging.

Related Issues (16)

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.