Package 

Object Logs


  • 
    public class Logs
    
                        

    An entry point to Datadog Logs feature.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static Logs INSTANCE
    • Method Summary

      Modifier and Type Method Description
      final static Unit enable(LogsConfiguration logsConfiguration, SdkCore sdkCore) Enables a Logs feature based on the configuration provided.
      final static Unit enable(LogsConfiguration logsConfiguration) Enables a Logs feature based on the configuration provided.
      final static Boolean isEnabled(SdkCore sdkCore) Identify whether a Logs has been enabled for the given SDK instance.
      final static Boolean isEnabled() Identify whether a Logs has been enabled for the given SDK instance.
      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.
      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.
      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.
      final static Unit removeAttribute(String key) Remove a custom attribute from all future logs sent by loggers created from the given SDK core.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 attribute
        value - the attribute value
        sdkCore - 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 attribute
        value - 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 remove
        sdkCore - 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