Microsoft.Extensions.Logging.EventSource.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>Microsoft.Extensions.Logging.EventSource</name>
  5. </assembly>
  6. <members>
  7. <member name="T:Microsoft.Extensions.Logging.EventSource.EventSourceLogger">
  8. <summary>
  9. A logger that writes messages to EventSource instance.
  10. </summary>
  11. <remarks>
  12. On Windows platforms EventSource will deliver messages using Event Tracing for Windows (ETW) events.
  13. On Linux EventSource will use LTTng (http://lttng.org) to deliver messages.
  14. </remarks>
  15. </member>
  16. <member name="T:Microsoft.Extensions.Logging.EventSource.EventSourceLogger.ActivityScope">
  17. <summary>
  18. ActivityScope is just a IDisposable that knows how to send the ActivityStop event when it is
  19. desposed. It is part of the BeginScope() support.
  20. </summary>
  21. </member>
  22. <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLogger.GetExceptionInfo(System.Exception)">
  23. <summary>
  24. 'serializes' a given exception into an ExceptionInfo (that EventSource knows how to serialize)
  25. </summary>
  26. <param name="exception">The exception to get information for.</param>
  27. <returns>ExceptionInfo object represending a .NET Exception</returns>
  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>
  29. </member>
  30. <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLogger.GetProperties(System.Object)">
  31. <summary>
  32. Converts an ILogger state object into a set of key-value pairs (That can be send to a EventSource)
  33. </summary>
  34. </member>
  35. <member name="T:Microsoft.Extensions.Logging.EventSource.EventSourceLoggerProvider">
  36. <summary>
  37. The provider for the <see cref="T:Microsoft.Extensions.Logging.EventSource.EventSourceLogger"/>.
  38. </summary>
  39. </member>
  40. <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLoggerProvider.CreateLogger(System.String)">
  41. <inheritdoc />
  42. </member>
  43. <member name="M:Microsoft.Extensions.Logging.EventSource.EventSourceLoggerProvider.Dispose">
  44. <inheritdoc />
  45. </member>
  46. <member name="T:Microsoft.Extensions.Logging.EventSource.ExceptionInfo">
  47. <summary>
  48. Represents information about exceptions that is captured by EventSourceLogger
  49. </summary>
  50. </member>
  51. <member name="T:Microsoft.Extensions.Logging.EventSource.LoggingEventSource">
  52. <summary>
  53. The LoggingEventSource is the bridge from all ILogger based logging to EventSource/EventListener logging.
  54. You turn this logging on by enabling the EventSource called
  55. Microsoft-Extensions-Logging
  56. When you enabled the EventSource, the EventLevel you set is translated in the obvious way to the level
  57. associated with the ILogger (thus Debug = verbose, Informational = Informational ... Critical == Critical)
  58. This allows you to filter by event level in a straightforward way.
  59. For finer control you can specify a EventSource Argument called
  60. FilterSpecs
  61. The FilterSpecs argument is a semicolon separated list of specifications. Where each specification is
  62. SPEC = // empty spec, same as *
  63. | NAME // Just a name the level is the default level
  64. | NAME : LEVEL // specifies level for a particular logger (can have a * suffix).
  65. When "UseAppFilters" is specified in the FilterSpecs, it avoids disabling all categories which happens by default otherwise.
  66. Where Name is the name of a ILoggger (case matters), Name can have a * which acts as a wildcard
  67. AS A SUFFIX. Thus Net* will match any loggers that start with the 'Net'.
  68. The LEVEL is a number or a LogLevel string. 0=Trace, 1=Debug, 2=Information, 3=Warning, 4=Error, Critical=5
  69. This specifies the level for the associated pattern. If the number is not specified, (first form
  70. of the specification) it is the default level for the EventSource.
  71. First match is used if a particular name matches more than one pattern.
  72. In addition the level and FilterSpec argument, you can also set EventSource Keywords. See the Keywords
  73. definition below, but basically you get to decide if you wish to have
  74. * Keywords.Message - You get the event with the data in parsed form.
  75. * Keywords.JsonMessage - you get an event with the data in parse form but as a JSON blob (not broken up by argument ...)
  76. * Keywords.FormattedMessage - you get an event with the data formatted as a string
  77. 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
  78. the same data logged three different ways.
  79. Example Usage
  80. This example shows how to use an EventListener to get ILogging information
  81. class MyEventListener : EventListener {
  82. protected override void OnEventSourceCreated(EventSource eventSource) {
  83. if (eventSource.Name == "Microsoft-Extensions-Logging") {
  84. // initialize a string, string dictionary of arguments to pass to the EventSource.
  85. // Turn on loggers matching App* to Information, everything else (*) is the default level (which is EventLevel.Error)
  86. var args = new Dictionary&lt;string, string&gt;() { { "FilterSpecs", "App*:Information;*" } };
  87. // Set the default level (verbosity) to Error, and only ask for the formatted messages in this case.
  88. EnableEvents(eventSource, EventLevel.Error, LoggingEventSource.Keywords.FormattedMessage, args);
  89. }
  90. }
  91. protected override void OnEventWritten(EventWrittenEventArgs eventData) {
  92. // Look for the formatted message event, which has the following argument layout (as defined in the LoggingEventSource.
  93. // FormattedMessage(LogLevel Level, int FactoryID, string LoggerName, string EventId, string FormattedMessage);
  94. if (eventData.EventName == "FormattedMessage")
  95. Console.WriteLine("Logger {0}: {1}", eventData.Payload[2], eventData.Payload[4]);
  96. }
  97. }
  98. </summary>
  99. </member>
  100. <member name="T:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords">
  101. <summary>
  102. This is public from an EventSource consumer point of view, but since these defintions
  103. are not needed outside this class
  104. </summary>
  105. </member>
  106. <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.Meta">
  107. <summary>
  108. Meta events are events about the LoggingEventSource itself (that is they did not come from ILogger
  109. </summary>
  110. </member>
  111. <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.Message">
  112. <summary>
  113. Turns on the 'Message' event when ILogger.Log() is called. It gives the information in a programmatic (not formatted) way
  114. </summary>
  115. </member>
  116. <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.FormattedMessage">
  117. <summary>
  118. Turns on the 'FormatMessage' event when ILogger.Log() is called. It gives the formatted string version of the information.
  119. </summary>
  120. </member>
  121. <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Keywords.JsonMessage">
  122. <summary>
  123. Turns on the 'MessageJson' event when ILogger.Log() is called. It gives JSON representation of the Arguments.
  124. </summary>
  125. </member>
  126. <member name="F:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.Instance">
  127. <summary>
  128. The one and only instance of the LoggingEventSource.
  129. </summary>
  130. </member>
  131. <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.FormattedMessage(Microsoft.Extensions.Logging.LogLevel,System.Int32,System.String,System.Int32,System.String,System.String)">
  132. <summary>
  133. FormattedMessage() is called when ILogger.Log() is called. and the FormattedMessage keyword is active
  134. This only gives you the human readable formatted message.
  135. </summary>
  136. </member>
  137. <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}})">
  138. <summary>
  139. Message() is called when ILogger.Log() is called. and the Message keyword is active
  140. This gives you the logged information in a programmatic format (arguments are key-value pairs)
  141. </summary>
  142. </member>
  143. <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}})">
  144. <summary>
  145. ActivityStart is called when ILogger.BeginScope() is called
  146. </summary>
  147. </member>
  148. <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.OnEventCommand(System.Diagnostics.Tracing.EventCommandEventArgs)">
  149. <inheritdoc />
  150. </member>
  151. <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.SetFilterSpec(System.String)">
  152. <summary>
  153. Set the filtering specification. null means turn off all loggers. Empty string is turn on all providers.
  154. </summary>
  155. <param name="filterSpec">The filter specification to set.</param>
  156. </member>
  157. <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.ParseFilterSpec(System.String,Microsoft.Extensions.Logging.LogLevel)">
  158. <summary>
  159. Given a set of specifications Pat1:Level1;Pat1;Level2 ... Where
  160. Pat is a string pattern (a logger Name with a optional trailing wildcard * char)
  161. and Level is a number 0 (Trace) through 5 (Critical).
  162. The :Level can be omitted (thus Pat1;Pat2 ...) in which case the level is 1 (Debug).
  163. A completely empty string act like * (all loggers set to Debug level).
  164. The first specification that 'loggers' Name matches is used.
  165. </summary>
  166. </member>
  167. <member name="M:Microsoft.Extensions.Logging.EventSource.LoggingEventSource.TryParseLevel(Microsoft.Extensions.Logging.LogLevel,System.String,Microsoft.Extensions.Logging.LogLevel@)">
  168. <summary>
  169. Parses the level specification (which should look like :N where n is a number 0 (Trace)
  170. through 5 (Critical). It can also be an empty string (which means 1 (Debug) and ';' marks
  171. the end of the specification. This specification should start at spec[curPos]
  172. It returns the value in 'ret' and returns true if successful. If false is returned ret is left unchanged.
  173. </summary>
  174. </member>
  175. <member name="T:Microsoft.Extensions.Logging.EventSourceLoggerFactoryExtensions">
  176. <summary>
  177. Extension methods for the <see cref="T:Microsoft.Extensions.Logging.ILoggerFactory"/> class.
  178. </summary>
  179. </member>
  180. <member name="M:Microsoft.Extensions.Logging.EventSourceLoggerFactoryExtensions.AddEventSourceLogger(Microsoft.Extensions.Logging.ILoggingBuilder)">
  181. <summary>
  182. Adds an event logger named 'EventSource' to the factory.
  183. </summary>
  184. <param name="builder">The extension method argument.</param>
  185. <returns>The <see cref="T:Microsoft.Extensions.Logging.ILoggingBuilder"/> so that additional calls can be chained.</returns>
  186. </member>
  187. <member name="T:Microsoft.Extensions.Logging.NullExternalScopeProvider">
  188. <summary>
  189. Scope provider that does nothing.
  190. </summary>
  191. </member>
  192. <member name="P:Microsoft.Extensions.Logging.NullExternalScopeProvider.Instance">
  193. <summary>
  194. Returns a cached instance of <see cref="T:Microsoft.Extensions.Logging.NullExternalScopeProvider"/>.
  195. </summary>
  196. </member>
  197. <member name="M:Microsoft.Extensions.Logging.NullExternalScopeProvider.Microsoft#Extensions#Logging#IExternalScopeProvider#ForEachScope``1(System.Action{System.Object,``0},``0)">
  198. <inheritdoc />
  199. </member>
  200. <member name="M:Microsoft.Extensions.Logging.NullExternalScopeProvider.Microsoft#Extensions#Logging#IExternalScopeProvider#Push(System.Object)">
  201. <inheritdoc />
  202. </member>
  203. <member name="T:Microsoft.Extensions.Logging.NullScope">
  204. <summary>
  205. An empty scope without any logic
  206. </summary>
  207. </member>
  208. <member name="M:Microsoft.Extensions.Logging.NullScope.Dispose">
  209. <inheritdoc />
  210. </member>
  211. </members>
  212. </doc>