Click or drag to resize

LogActivity Structure

Used to help log correlate lower-level operations with a higher-level activity.

Namespace:  Neon.Diagnostics
Assembly:  Neon.Common (in Neon.Common.dll) Version: 2.14.0
public struct LogActivity

The LogActivity type exposes the following members.

Public propertyId
Returns the activity ID.
Public methodStatic memberCreate
Creates a log activity with a new globally unique ID.
Public methodCritical(Object)
Logs a critical message.
Public methodCritical(Object, Exception)
Logs a critical message along with exception information.
Public methodDebug(Object)
Logs a debug message.
Public methodDebug(Object, Exception)
Logs a debug message along with exception information.
Public methodEquals
Indicates whether this instance and a specified object are equal.
(Inherited from ValueType.)
Public methodError(Object)
Logs an error message.
Public methodError(Object, Exception)
Logs an error message along with exception information.
Public methodStatic memberFrom
Creates a log activity with the ID specified.
Public methodGetHashCode
Returns the hash code for this instance.
(Inherited from ValueType.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInfo(Object)
Logs an info message.
Public methodInfo(Object, Exception)
Logs an info message along with exception information.
Public methodToString
Returns the fully qualified type name of this instance.
(Inherited from ValueType.)
Public methodWarn(Object)
Logs a warn message.
Public methodWarn(Object, Exception)
Logs a warn message along with exception information.
Public fieldStatic memberHttpHeader
Names the HTTP header used to hold the activity ID used to correlate operation requests with a higher-level activity.

This structure is intended to help operators and developers correlate lower-level operations with higher level activities that may span multiple systems and services.

The essential idea is to associate a globally unique ID with a high-level activity and then include this ID along with events logged by the various systems and services that participate in the activity. Ultimately, the logged events with the activity IDs will make it to Elasticsearch or some other log database where activaty events potentially spanning many systems can be correlated and analyzed.

An activity ID is simply a globally unique ID string. IDs generated by this class are a currently stringified Guid but IDs may take other forms so, don't depend on this.

In general, activity IDs are passed from service to service via the HTTP X-Request-ID request header (defined by HttpHeader).

To use this type, call the static Create(INeonLogger) method to create a new activity or From(String, INeonLogger) to associate an instance with an existing activity. Then use the various logging methods to emit log events what will include the activity ID.

See Also