Class ILogger

Inheritance Relationships

Derived Type

Class Documentation

class Microsoft::Applications::Events::ILogger

ILogger interface for logging either semantic or custom event

Subclassed by Microsoft::Applications::Events::NullLogger

Public Functions

inline virtual ~ILogger()

The ILogger destructor.

virtual ISemanticContext *GetSemanticContext() const = 0

Gets an ISemanticContext interface through which you can specify the semantic context for this logger instance.

Returns

An instance of the ISemanticContext interface.

virtual void SetContext(const std::string &name, const char value[], PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a constant pointer to a character array that contains the property’s string value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A constant pointer to a character array that contains the property’s string value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, const std::string &value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a string that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A string that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, double value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a double that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A double that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, int64_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, an int64_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – An int64_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, int8_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, an int8_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – An int8_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, int16_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, an int16_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – An int16_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, int32_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, an int32_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – An int32_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, uint8_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a uint8_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A uint8_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, uint16_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a uint16_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A uint16_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, uint32_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a uint32_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A uint32_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, uint64_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a uint64_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A uint64_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, bool value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a boolean that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A boolean that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, time_ticks_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a .NET time_ticks_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A .NET time_ticks_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, GUID_t value, PiiKind piiKind = PiiKind_None) = 0

Adds (or overrides) a property of the context associated with this logger instance, taking a string that contains the name of the context, a GUID_t that contains the property value, and tags the property with its PiiKind (Personal Identifiable Information kind).

Parameters
  • name – A string that contains the name of the property.

  • value – A GUID_t that contains the property value.

  • piiKind – One of the ::PiiKind enumeration values. If you don’t specify a value, then the default PiiKind_None is used.

virtual void SetContext(const std::string &name, const EventProperty &prop) = 0

Populate event property using EventProperty value object.

Parameters
  • name – Property name.

  • prop – Property value object.

virtual void SetParentContext(ISemanticContext *context) = 0

Allows the logger to inherit the alternate parent context.

Default context wiring rules:

  • host loggers inherit their common host LogManager context.

  • guest loggers do not inherit their host LogManager context due to privacy reasons.

Parameters

context – The context.

virtual void LogAppLifecycle(AppLifecycleState state, EventProperties const &properties) = 0

Logs the state of the application lifecycle.

Parameters
  • state – The state in the application’s lifecycle, specified by one of the ::AppLifecycleState enumeration values.

  • properties – Properties of this AppLifecycle event, specified using an EventProperties object.

virtual void LogSession(SessionState state, const EventProperties &properties) = 0

Logs the state of the application session.

Parameters
  • state – The state in the application’s lifecycle, as one of the SessionState enumeration values.

  • properties – Properties of this session event, specified using an EventProperties object.

virtual void LogEvent(std::string const &name) = 0

Logs the custom event with the specified name.

Parameters

name – A string that contains the name of the custom event.

virtual void LogEvent(EventProperties const &properties) = 0

Logs a custom event with the specified name and properties.

Parameters

properties – Properties of this custom event, specified using an EventProperties object.

virtual void LogFailure(std::string const &signature, std::string const &detail, EventProperties const &properties) = 0

Logs a failure event - such as an application exception.

Parameters
  • signature – A string that contains the signature that identifies the bucket of the failure.

  • detail – A string that contains a description of the failure.

  • properties – Properties of this failure event, specified using an EventProperties object.

virtual void LogFailure(std::string const &signature, std::string const &detail, std::string const &category, std::string const &id, EventProperties const &properties) = 0

Logs a failure event - such as an application exception.

Parameters
  • signature – A string that contains the signature that identifies the bucket of the failure.

  • detail – A string that contains a description of the failure.

  • category – A string that contains the category of the failure - such as an application error, application not responding, or application crash

  • id – A string that contains the identifier that uniquely identifies this failure.

  • properties – Properties of this failure event, specified using an EventProperties object.

virtual void LogPageView(std::string const &id, std::string const &pageName, EventProperties const &properties) = 0

Logs a page view event, taking a string that contains the event identifier, a string that contains a friendly name for the page, and properties of the event.

Note: A page view event is normally the result of a user action on a UI page such as a search query, a content request, or a page navigation.

Parameters
  • id – A string that contains an identifier that uniquely identifies this page.

  • pageName – A string that contains the friendly name of the page.

  • properties – Properties of this page view event, specified using an EventProperties object.

virtual void LogPageView(std::string const &id, std::string const &pageName, std::string const &category, std::string const &uri, std::string const &referrerUri, EventProperties const &properties) = 0

Logs a page view event, taking a string that contains the event identifier, a string that contains a friendly name for the page, a string that contains the page category, a string that contains the page’s URI, a string that contains the referring page’s URI, and properties of the event.

Note: A page view event is normally the result of a user action on a UI page such as a search query, a content request, or a page navigation.

Parameters
  • id – A string that contains the identifier that uniquely identifies this page.

  • pageName – A string that contains the friendly name of the page.

  • category – A string that contains the category to which this page belongs.

  • uri – A string that contains the URI of this page.

  • referrerUri – A string that contains the URI of the page that refers to this page.

  • properties – Properties of this page view event, specified using an EventProperties object.

virtual void LogPageAction(std::string const &pageViewId, ActionType actionType, EventProperties const &properties) = 0

Logs a page action event, taking a string that contains the page view identifier, the action type, and the action event properties.

Parameters
  • pageViewId – A string that contains an identifier that uniquely identifies the page view.

  • actionType – The generic type of the page action, specified as one of the ::ActionType enumeration values.

  • properties – Properties of this page action event, specified using an EventProperties object.

virtual void LogPageAction(PageActionData const &pageActionData, EventProperties const &properties) = 0

Logs a detailed page action event, taking a reference to the page action data, and the action event properties.

Parameters
  • pageActionData – Detailed information about the page action, contained in a PageActionData object.

  • properties – Properties of this page action event, contained in an EventProperties object.

virtual void LogSampledMetric(std::string const &name, double value, std::string const &units, EventProperties const &properties) = 0

Logs a sampled metric event - such as a performance counter, taking a name for the sampled metric, a double that contains the value of the sampled metric, a string that contains the units of measure of the sampled metric, and a reference to an EventProperties object to hold the values.

Parameters
  • name – A string that contains the name of the sampled metric.

  • value – A double that holds the value of the sampled metric.

  • units – A string that contains the units of the metric value.

  • properties – Properties of this sampled metric event, specified using an EventProperties object.

virtual void LogSampledMetric(std::string const &name, double value, std::string const &units, std::string const &instanceName, std::string const &objectClass, std::string const &objectId, EventProperties const &properties) = 0

Logs a sampled metric event - such as a performance counter, taking a name for the sampled metric, a double that contains the value of the sampled metric, a string that contains the units of measure of the sampled metric, a string that contains the name of the metric instance, a string that contains the name of the object class, a string that contains the object identifier, and a reference to an EventProperties object to hold the values.

Parameters
  • name – A string that contains the name of the sampled metric.

  • value – A double that contains the value of the sampled metric.

  • units – A string that contains the units of the metric value.

  • instanceName – A string that contains the name of this metric instance. E.g., performance counter.

  • objectClass – A string that contains the object class for which this metric tracks.

  • objectId – A string that contains the object identifier for which this metric tracks.

  • properties – Properties of this sampled metric event, specified using an EventProperties object.

virtual void LogAggregatedMetric(std::string const &name, long duration, long count, EventProperties const &properties) = 0

Logs a precomputed aggregated metric event.

For example, queue length.

Parameters
  • name – A string that contains the name of the aggregated metric.

  • duration – A long that contains the duration (in microseconds) over which this metric is aggregated.

  • count – A long that contains the count of the aggregated metric observations.

  • properties – Properties of this aggregated metric event, specified using an EventProperties object.

virtual void LogAggregatedMetric(AggregatedMetricData const &metricData, EventProperties const &properties) = 0

Logs a precomputed aggregated metrics event, taking a reference to an AggregatedMetricData object, and a reference to a EventProperties object.

Parameters
  • metricData – Detailed information about the aggregated metric, contained in an AggregatedMetricData object.

  • properties – Properties of this aggregated metric event, specified in an EventProperties object.

virtual void LogTrace(TraceLevel level, std::string const &message, EventProperties const &properties) = 0

Logs a trace event for troubleshooting.

Parameters
  • level – Level of the trace, as one of the TraceLevel enumeration values.

  • message – A string that contains the a description of the trace.

  • properties – Properties of this trace event, specified using an EventProperties object.

virtual void LogUserState(UserState state, long timeToLiveInMillis, EventProperties const &properties) = 0

Logs a user’s state.

Parameters
  • state – The user’s reported state, specified using one of the ::UserState enumeration values.

  • timeToLiveInMillis – A long that contains the duration (in milliseconds) for which the state reported is valid.

  • properties – Properties of this user state event, specified using an EventProperties object.

virtual void SetLevel(uint8_t level) = 0

Set default diagnostic level of this logger instance.

Parameters

level – Diagnostic level.

virtual IEventFilterCollection &GetEventFilters() noexcept = 0

Get collection of current event filters.

virtual IEventFilterCollection const &GetEventFilters() const noexcept = 0

Get collection of current event filters.