Class: AWSCDK::Greengrass::CfnLoggerDefinitionVersion::LoggerProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
greengrass/cfn_logger_definition_version.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 AWS::Greengrass::LoggerDefinitionVersion resource 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.



525
526
527
528
529
530
531
532
533
534
535
536
# File 'greengrass/cfn_logger_definition_version.rb', line 525

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.



544
545
546
# File 'greengrass/cfn_logger_definition_version.rb', line 544

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:_-]+ .



551
552
553
# File 'greengrass/cfn_logger_definition_version.rb', line 551

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 .



558
559
560
# File 'greengrass/cfn_logger_definition_version.rb', line 558

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 .



572
573
574
# File 'greengrass/cfn_logger_definition_version.rb', line 572

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.



565
566
567
# File 'greengrass/cfn_logger_definition_version.rb', line 565

def type
  @type
end

Class Method Details

.jsii_propertiesObject



574
575
576
577
578
579
580
581
582
# File 'greengrass/cfn_logger_definition_version.rb', line 574

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

Instance Method Details

#to_jsiiObject



584
585
586
587
588
589
590
591
592
593
594
# File 'greengrass/cfn_logger_definition_version.rb', line 584

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