2 Answers
- Newest
- Most votes
- Most comments
0
I'm using below sample code to log the verbose information of AWS JS SDK v3.
import { DescribeParametersCommand, SSMClient } from "@aws-sdk/client-ssm"; import * as log4js from "log4js"; log4js.configure({ appenders: { cheese: { type: "file", filename: "cheese.log" } }, categories: { default: { appenders: ["cheese"], level: "error" } }, }); const logger = log4js.getLogger(); logger.level = "debug"; async function main() { const ssmClient = new SSMClient({ logger: logger, }); const parameters = await ssmClient.send(new DescribeParametersCommand({})); console.log(parameters); }
Update on 11/2: A blog post with working code snippet
answered a year ago
-1
Hi there,
Thank you for reaching out to us.
- Please check this link to enable Logging AWS SDK for JavaScript Calls. (Version 2)
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/logging-sdk-calls.html
To turn on the logger and print log entries in the console, add the following statement to your code. [ AWS.config.logger = console; ]
- Please check this link to enable Logging AWS SDK for JavaScript Calls. (Version 3)
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/interfaces/_aws_sdk_types.logger-1.html#debug https://github.com/aws/aws-sdk-js-v3/blob/e77e1150/packages/types/src/logger.ts#L31
- For AWS CLI, you can add " --debug " at the end of the command as well. [Check the example on the link below]
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-troubleshooting.html#general-debug
I hope this helps! Thank you!
Have A Nice Day!
Relevant content
- Accepted Answerasked 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a month ago
The step 2 for SDK v3, the link is about to the
logger
utility of SDK library, not it's a doc about how enabling debugging log of SDK itself.