public static class ILoggerExtensions
Extensions for ILogger to allow augmenting the logged information with contextual data. GoogleLogger" will add the information to the LogEntry that is sent to Google Cloud Logging. For the consumption of other loggers, the information will be included in newly created scopes at the moment of logging, in a format that all loggers should understand.
Namespace
Google.Cloud.Diagnostics.CommonAssembly
Google.Cloud.Diagnostics.Common.dll
Methods
WithAddedLabels(ILogger, IEnumerable<KeyValuePair<String, String>>)
public static ILogger WithAddedLabels(this ILogger logger, IEnumerable<KeyValuePair<string, string>> labels)
Adds labels to the returned logger that may be included with every subsequent log.
How this information is included will depend on the actual logger
.
GoogleLogger" will include this information in Labels.
For the consumption of other loggers, the information will be included in newly created scopes
at the moment of logging, in a format that all loggers should understand.
If logger
had already been augmented with labels, labels
will be added to the existing ones on the returned ILogger
Parameters | |
---|---|
Name | Description |
logger | ILogger |
labels | IEnumerable<KeyValuePair<String, String>> |
Returns | |
---|---|
Type | Description |
ILogger |
WithAddedLabels(ILogger, KeyValuePair<String, String>[])
public static ILogger WithAddedLabels(this ILogger logger, params KeyValuePair<string, string>[] labels)
Adds labels to the returned logger that may be included with every subsequent log.
How this information is included will depend on the actual logger
.
GoogleLogger" will include this information in Labels.
For the consumption of other loggers, the information will be included in newly created scopes
at the moment of logging, in a format that all loggers should understand.
If logger
had already been augmented with labels, labels
will be added to the existing ones on the returned ILogger
Parameters | |
---|---|
Name | Description |
logger | ILogger |
labels | KeyValuePair<String, String>[] |
Returns | |
---|---|
Type | Description |
ILogger |
WithLabels(ILogger, IEnumerable<KeyValuePair<String, String>>)
public static ILogger WithLabels(this ILogger logger, IEnumerable<KeyValuePair<string, string>> labels)
Adds labels to the returned logger that may be included with every subsequent log.
How this information is included will depend on the actual logger
.
GoogleLogger" will include this information in Labels.
For the consumption of other loggers, the information will be included in newly created scopes
at the moment of logging, in a format that all loggers should understand.
If logger
had already been augmented with labels, the old labels will be replaced
by the new ones on the returned ILogger.
Parameters | |
---|---|
Name | Description |
logger | ILogger |
labels | IEnumerable<KeyValuePair<String, String>> |
Returns | |
---|---|
Type | Description |
ILogger |
WithLabels(ILogger, KeyValuePair<String, String>[])
public static ILogger WithLabels(this ILogger logger, params KeyValuePair<string, string>[] labels)
Adds labels to the returned logger that may be included with every subsequent log.
How this information is included will depend on the actual logger
.
GoogleLogger" will include this information in Labels.
For the consumption of other loggers, the information will be included in newly created scopes
at the moment of logging, in a format that all loggers should understand.
If logger
had already been augmented with labels, the old labels will be replaced
by the new ones on the returned ILogger.
Parameters | |
---|---|
Name | Description |
logger | ILogger |
labels | KeyValuePair<String, String>[] |
Returns | |
---|---|
Type | Description |
ILogger |