-
public class LogsAn entry point to Datadog Logs feature.
-
-
Method Summary
Modifier and Type Method Description final static Unitenable(LogsConfiguration logsConfiguration, SdkCore sdkCore)Enables a Logs feature based on the configuration provided. final static Unitenable(LogsConfiguration logsConfiguration)Enables a Logs feature based on the configuration provided. final static BooleanisEnabled(SdkCore sdkCore)Identify whether a Logs has been enabled for the given SDK instance. final static BooleanisEnabled()Identify whether a Logs has been enabled for the given SDK instance. final static UnitaddAttribute(String key, Object value, SdkCore sdkCore)Add a custom attribute to all future logs sent by loggers created from the given SDK core. final static UnitaddAttribute(String key, Object value)Add a custom attribute to all future logs sent by loggers created from the given SDK core. final static UnitremoveAttribute(String key, SdkCore sdkCore)Remove a custom attribute from all future logs sent by loggers created from the given SDK core. final static UnitremoveAttribute(String key)Remove a custom attribute from all future logs sent by loggers created from the given SDK core. -
-
Method Detail
-
enable
@JvmOverloads() final static Unit enable(LogsConfiguration logsConfiguration, SdkCore sdkCore)
Enables a Logs feature based on the configuration provided.
- Parameters:
logsConfiguration- Configuration to use for the feature.sdkCore- SDK instance to register feature in.
-
enable
@JvmOverloads() final static Unit enable(LogsConfiguration logsConfiguration)
Enables a Logs feature based on the configuration provided.
- Parameters:
logsConfiguration- Configuration to use for the feature.
-
isEnabled
@JvmOverloads() final static Boolean isEnabled(SdkCore sdkCore)
Identify whether a Logs has been enabled for the given SDK instance.
This check is useful in scenarios where more than one component may be responsible for enabling the feature
- Parameters:
sdkCore- the SdkCore instance to check against.
-
isEnabled
@JvmOverloads() final static Boolean isEnabled()
Identify whether a Logs has been enabled for the given SDK instance.
This check is useful in scenarios where more than one component may be responsible for enabling the feature
-
addAttribute
@JvmOverloads() final static Unit addAttribute(String key, Object value, SdkCore sdkCore)
Add a custom attribute to all future logs sent by loggers created from the given SDK core.
Values can be nested up to 10 levels deep. Keys using more than 10 levels will be sanitized by SDK.
- Parameters:
key- the key for this attributevalue- the attribute valuesdkCore- the SdkCore instance to add the attribute to.
-
addAttribute
@JvmOverloads() final static Unit addAttribute(String key, Object value)
Add a custom attribute to all future logs sent by loggers created from the given SDK core.
Values can be nested up to 10 levels deep. Keys using more than 10 levels will be sanitized by SDK.
- Parameters:
key- the key for this attributevalue- the attribute value
-
removeAttribute
@JvmOverloads() final static Unit removeAttribute(String key, SdkCore sdkCore)
Remove a custom attribute from all future logs sent by loggers created from the given SDK core.
Previous logs won't lose the attribute value associated with this key if they were created prior to this call.
- Parameters:
key- the key of the attribute to removesdkCore- the SdkCore instance to remove the attribute from.
-
removeAttribute
@JvmOverloads() final static Unit removeAttribute(String key)
Remove a custom attribute from all future logs sent by loggers created from the given SDK core.
Previous logs won't lose the attribute value associated with this key if they were created prior to this call.
- Parameters:
key- the key of the attribute to remove
-
-
-
-