CmdID / aws / aws greengrass
aws greengrass create-logger-definition
Creates a logger definition. AWS CLI reference
1 example 4 options Its page in the AWS CLI reference
Examples
To create a logger definition
The following create-logger-definition example creates a logger definition that contains an initial logger definition version. The initial version defines three logging configurations: 1) system component logs on the file system of the core device, 2) user-defined Lambda function logs on the file system of the core device, and 3) user-defined Lambda function logs in Amazon CloudWatch Logs. Note: For CloudWatch Logs integration, your group role must grant appropriate permissions.
aws greengrass create-logger-definition --name "LoggingConfigs" --initial-version "{\"Loggers\":[{\"Id\":\"1\",\"Component\":\"GreengrassSystem\",\"Level\":\"ERROR\",\"Space\":10240,\"Type\":\"FileSystem\"},{\"Id\":\"2\",\"Component\":\"Lambda\",\"Level\":\"INFO\",\"Space\":10240,\"Type\":\"FileSystem\"},{\"Id\":\"3\",\"Component\":\"Lambda\",\"Level\":\"INFO\",\"Type\":\"AWSCloudWatch\"}]}"Identify--nameThe name of the logger definition.--initial-versionInformation about the initial version of the logger definition.Its output
{
"LatestVersionArn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/loggers/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111/versions/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
"Name": "LoggingConfigs",
"LastUpdatedTimestamp": "2019-07-23T23:52:17.165Z",
"LatestVersion": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
"CreationTimestamp": "2019-07-23T23:52:17.165Z",
"Id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/loggers/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
}For more information, see Monitoring with AWS IoT Greengrass logs in the AWS IoT Greengrass Developer Guide.
Options
--amzn-client-tokenA client token used to correlate requests and responses.--initial-versionInformation about the initial version of the logger definition.--nameThe name of the logger definition.--tagsTag(s) to add to the new resource.