Class: AWSCDK::Greengrass::CfnLoggerDefinition::LoggerProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
greengrass/cfn_logger_definition.rb

Overview

A logger represents logging settings for the AWS IoT Greengrass group, which can be stored in CloudWatch and the local file system of your core device.

All log entries include a timestamp, log level, and information about the event. For more information, see Monitoring with AWS IoT Greengrass Logs in the Developer Guide .

In an CloudFormation template, the Loggers property of the LoggerDefinitionVersion property type contains a list of Logger property types.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component:, id:, level:, type:, space: nil) ⇒ LoggerProperty

Returns a new instance of LoggerProperty.

Parameters:

  • component (String)

    The source of the log event.

  • id (String)

    A descriptive or arbitrary ID for the logger.

  • level (String)

    The log-level threshold.

  • type (String)

    The storage mechanism for log events.

  • space (Numeric, nil) (defaults to: nil)

    The amount of file space (in KB) to use when writing logs to the local file system.



646
647
648
649
650
651
652
653
654
655
656
657
# File 'greengrass/cfn_logger_definition.rb', line 646

def initialize(component:, id:, level:, type:, space: nil)
  @component = component
  Jsii::Type.check_type(@component, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "component")
  @id = id
  Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  @level = level
  Jsii::Type.check_type(@level, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "level")
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @space = space
  Jsii::Type.check_type(@space, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "space") unless @space.nil?
end

Instance Attribute Details

#componentString (readonly)

The source of the log event.

Valid values are GreengrassSystem or Lambda . When GreengrassSystem is used, events from Greengrass system components are logged. When Lambda is used, events from user-defined Lambda functions are logged.



665
666
667
# File 'greengrass/cfn_logger_definition.rb', line 665

def component
  @component
end

#idString (readonly)

A descriptive or arbitrary ID for the logger.

This value must be unique within the logger definition version. Maximum length is 128 characters with pattern [a-zA-Z0-9:_-]+ .



672
673
674
# File 'greengrass/cfn_logger_definition.rb', line 672

def id
  @id
end

#levelString (readonly)

The log-level threshold.

Log events below this threshold are filtered out and aren't stored. Valid values are DEBUG , INFO (recommended), WARN , ERROR , or FATAL .



679
680
681
# File 'greengrass/cfn_logger_definition.rb', line 679

def level
  @level
end

#spaceNumeric? (readonly)

The amount of file space (in KB) to use when writing logs to the local file system.

This property does not apply for CloudWatch Logs .



693
694
695
# File 'greengrass/cfn_logger_definition.rb', line 693

def space
  @space
end

#typeString (readonly)

The storage mechanism for log events.

Valid values are FileSystem or AWSCloudWatch . When AWSCloudWatch is used, log events are sent to CloudWatch Logs . When FileSystem is used, log events are stored on the local file system.



686
687
688
# File 'greengrass/cfn_logger_definition.rb', line 686

def type
  @type
end

Class Method Details

.jsii_propertiesObject



695
696
697
698
699
700
701
702
703
# File 'greengrass/cfn_logger_definition.rb', line 695

def self.jsii_properties
  {
    :component => "component",
    :id => "id",
    :level => "level",
    :type => "type",
    :space => "space",
  }
end

Instance Method Details

#to_jsiiObject



705
706
707
708
709
710
711
712
713
714
715
# File 'greengrass/cfn_logger_definition.rb', line 705

def to_jsii
  result = {}
  result.merge!({
    "component" => @component,
    "id" => @id,
    "level" => @level,
    "type" => @type,
    "space" => @space,
  })
  result.compact
end