Comments (9)
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.
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.
@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.
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.
@pysco68 EventId is identifier for logs written to Windows eventlog, providing easy monitoring etc.
from nlog.owin.logging.
fixed in #17
from nlog.owin.logging.
Will be released as 1.1. Thanks for reporting, @pysco68 thanks for fixing!
from nlog.owin.logging.
https://www.nuget.org/packages/NLog.Owin.Logging/1.1.0
from nlog.owin.logging.
@304NotModified nice, ty
from nlog.owin.logging.
Related Issues (16)
- Rename repos
- Add to NLog/NLog readme HOT 1
- Add Nuget installation instruction
- Add nuget badge HOT 1
- "Incorrect" {callsite} value in log file HOT 7
- Add example of using Nlog adapter inside Controller HOT 2
- Add appveyor integration
- Build broken HOT 1
- Add codecov integration
- Create new release HOT 1
- Update docs for new version HOT 1
- Drop or update/publish gh-pages branch
- Skip eventid-property when using default value zero
- Strong naming
- EOL normalization HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nlog.owin.logging.