1 <?xml version="1.0"?>
\r
4 <name>Microsoft.Extensions.Logging.EventSource</name>
\r
7 <member name="T:Microsoft.Extensions.Logging.EventSource.EventSourceLogger">
\r
9 A logger that writes messages to EventSource instance.
\r
12 On Windows platforms EventSource will deliver messages using Event Tracing for Windows (ETW) events.
\r
13 On Linux EventSource will use LTTng (http://lttng.org) to deliver messages.
\r
16 <member name="T:Microsoft.Extensions.Logging.EventSource.EventSourceLogger.ActivityScope">
\r
18 ActivityScope is just a IDisposable that knows how to send the ActivityStop event when it is
\r
19 desposed. It is part of the BeginScope() support.
\r
22 <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLogger.GetExceptionInfo(System.Exception)">
\r
24 'serializes' a given exception into an ExceptionInfo (that EventSource knows how to serialize)
\r
26 <param name="exception">The exception to get information for.</param>
\r
27 <returns>ExceptionInfo object represending a .NET Exception</returns>
\r
28 <remarks>ETW does not support a concept of a null value. So we use an un-initialized object if there is no exception in the event data.</remarks>
\r
30 <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLogger.GetProperties(System.Object)">
\r
32 Converts an ILogger state object into a set of key-value pairs (That can be send to a EventSource)
\r
35 <member name="T:Microsoft.Extensions.Logging.EventSource.EventSourceLoggerProvider">
\r
37 The provider for the <see cref="T:Microsoft.Extensions.Logging.EventSource.EventSourceLogger"/>.
\r
40 <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLoggerProvider.#ctor(Microsoft.Extensions.Logging.EventSource.LoggingEventSource)">
\r
43 <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLoggerProvider.CreateLogger(System.String)">
\r
46 <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLoggerProvider.Dispose">
\r
49 <member name="T:Microsoft.Extensions.Logging.EventSource.ExceptionInfo">
\r
51 Represents information about exceptions that is captured by EventSourceLogger
\r
54 <member name="T:Microsoft.Extensions.Logging.EventSource.LoggingEventSource">
\r
56 The LoggingEventSource is the bridge from all ILogger based logging to EventSource/EventListener logging.
\r
58 You turn this logging on by enabling the EventSource called
\r
60 Microsoft-Extensions-Logging
\r
62 When you enabled the EventSource, the EventLevel you set is translated in the obvious way to the level
\r
63 associated with the ILogger (thus Debug = verbose, Informational = Informational ... Critical == Critical)
\r
65 This allows you to filter by event level in a straightforward way.
\r
67 For finer control you can specify a EventSource Argument called
\r
71 The FilterSpecs argument is a semicolon separated list of specifications. Where each specification is
\r
73 SPEC = // empty spec, same as *
\r
74 | NAME // Just a name the level is the default level
\r
75 | NAME : LEVEL // specifies level for a particular logger (can have a * suffix).
\r
77 Where Name is the name of a ILoggger (case matters), Name can have a * which acts as a wildcard
\r
78 AS A SUFFIX. Thus Net* will match any loggers that start with the 'Net'.
\r
80 The LEVEL is a number or a LogLevel string. 0=Trace, 1=Debug, 2=Information, 3=Warning, 4=Error, Critical=5
\r
81 This specifies the level for the associated pattern. If the number is not specified, (first form
\r
82 of the specification) it is the default level for the EventSource.
\r
84 First match is used if a particular name matches more than one pattern.
\r
86 In addition the level and FilterSpec argument, you can also set EventSource Keywords. See the Keywords
\r
87 definition below, but basically you get to decide if you wish to have
\r
89 * Keywords.Message - You get the event with the data in parsed form.
\r
90 * Keywords.JsonMessage - you get an event with the data in parse form but as a JSON blob (not broken up by argument ...)
\r
91 * Keywords.FormattedMessage - you get an event with the data formatted as a string
\r
93 It is expected that you will turn only one of these keywords on at a time, but you can turn them all on (and get
\r
94 the same data logged three different ways.
\r
98 This example shows how to use an EventListener to get ILogging information
\r
100 class MyEventListener : EventListener {
\r
101 protected override void OnEventSourceCreated(EventSource eventSource) {
\r
102 if (eventSource.Name == "Microsoft-Extensions-Logging") {
\r
103 // initialize a string, string dictionary of arguments to pass to the EventSource.
\r
104 // Turn on loggers matching App* to Information, everything else (*) is the default level (which is EventLevel.Error)
\r
105 var args = new Dictionary<string, string>() { { "FilterSpecs", "App*:Information;*" } };
\r
106 // Set the default level (verbosity) to Error, and only ask for the formatted messages in this case.
\r
107 EnableEvents(eventSource, EventLevel.Error, LoggingEventSource.Keywords.FormattedMessage, args);
\r
110 protected override void OnEventWritten(EventWrittenEventArgs eventData) {
\r
111 // Look for the formatted message event, which has the following argument layout (as defined in the LoggingEventSource.
\r
112 // FormattedMessage(LogLevel Level, int FactoryID, string LoggerName, string EventId, string FormattedMessage);
\r
113 if (eventData.EventName == "FormattedMessage")
\r
114 Console.WriteLine("Logger {0}: {1}", eventData.Payload[2], eventData.Payload[4]);
\r
119 <member name="T:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords">
\r
121 This is public from an EventSource consumer point of view, but since these defintions
\r
122 are not needed outside this class
\r
125 <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.Meta">
\r
127 Meta events are events about the LoggingEventSource itself (that is they did not come from ILogger
\r
130 <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.Message">
\r
132 Turns on the 'Message' event when ILogger.Log() is called. It gives the information in a programmatic (not formatted) way
\r
135 <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.FormattedMessage">
\r
137 Turns on the 'FormatMessage' event when ILogger.Log() is called. It gives the formatted string version of the information.
\r
140 <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.JsonMessage">
\r
142 Turns on the 'MessageJson' event when ILogger.Log() is called. It gives JSON representation of the Arguments.
\r
145 <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Instance">
\r
147 The one and only instance of the LoggingEventSource.
\r
150 <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.FormattedMessage(Microsoft.Extensions.Logging.LogLevel,System.Int32,System.String,System.Int32,System.String,System.String)">
\r
152 FormattedMessage() is called when ILogger.Log() is called. and the FormattedMessage keyword is active
\r
153 This only gives you the human readable formatted message.
\r
156 <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Message(Microsoft.Extensions.Logging.LogLevel,System.Int32,System.String,System.Int32,System.String,Microsoft.Extensions.Logging.EventSource.ExceptionInfo,System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.String}})">
\r
158 Message() is called when ILogger.Log() is called. and the Message keyword is active
\r
159 This gives you the logged information in a programmatic format (arguments are key-value pairs)
\r
162 <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.ActivityStart(System.Int32,System.Int32,System.String,System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.String}})">
\r
164 ActivityStart is called when ILogger.BeginScope() is called
\r
167 <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.OnEventCommand(System.Diagnostics.Tracing.EventCommandEventArgs)">
\r
170 <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.SetFilterSpec(System.String)">
\r
172 Set the filtering specification. null means turn off all loggers. Empty string is turn on all providers.
\r
174 <param name="filterSpec">The filter specification to set.</param>
\r
176 <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.ParseFilterSpec(System.String,Microsoft.Extensions.Logging.LogLevel)">
\r
178 Given a set of specifications Pat1:Level1;Pat1;Level2 ... Where
\r
179 Pat is a string pattern (a logger Name with a optional trailing wildcard * char)
\r
180 and Level is a number 0 (Trace) through 5 (Critical).
\r
182 The :Level can be omitted (thus Pat1;Pat2 ...) in which case the level is 1 (Debug).
\r
184 A completely empty string act like * (all loggers set to Debug level).
\r
186 The first specification that 'loggers' Name matches is used.
\r
189 <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.TryParseLevel(Microsoft.Extensions.Logging.LogLevel,System.String,Microsoft.Extensions.Logging.LogLevel@)">
\r
191 Parses the level specification (which should look like :N where n is a number 0 (Trace)
\r
192 through 5 (Critical). It can also be an empty string (which means 1 (Debug) and ';' marks
\r
193 the end of the specification. This specification should start at spec[curPos]
\r
194 It returns the value in 'ret' and returns true if successful. If false is returned ret is left unchanged.
\r
197 <member name="T:Microsoft.Extensions.Logging.EventSourceLoggerFactoryExtensions">
\r
199 Extension methods for the <see cref="T:Microsoft.Extensions.Logging.ILoggerFactory"/> class.
\r
202 <member name="M:Microsoft.Extensions.Logging.EventSourceLoggerFactoryExtensions.AddEventSourceLogger(Microsoft.Extensions.Logging.ILoggingBuilder)">
\r
204 Adds an event logger named 'EventSource' to the factory.
\r
206 <param name="builder">The extension method argument.</param>
\r
207 <returns>The <see cref="T:Microsoft.Extensions.Logging.ILoggingBuilder"/> so that additional calls can be chained.</returns>
\r
209 <member name="T:Microsoft.Extensions.Logging.NullExternalScopeProvider">
\r
211 Scope provider that does nothing.
\r
214 <member name="P:Microsoft.Extensions.Logging.NullExternalScopeProvider.Instance">
\r
216 Returns a cached instance of <see cref="T:Microsoft.Extensions.Logging.NullExternalScopeProvider"/>.
\r
219 <member name="M:Microsoft.Extensions.Logging.NullExternalScopeProvider.Microsoft#Extensions#Logging#IExternalScopeProvider#ForEachScope``1(System.Action{System.Object,``0},``0)">
\r
222 <member name="M:Microsoft.Extensions.Logging.NullExternalScopeProvider.Microsoft#Extensions#Logging#IExternalScopeProvider#Push(System.Object)">
\r
225 <member name="T:Microsoft.Extensions.Logging.NullScope">
\r
227 An empty scope without any logic
\r
230 <member name="M:Microsoft.Extensions.Logging.NullScope.Dispose">
\r