Closed cristobalbl86 closed 6 months ago
Hi @cristobalbl86 thank you for opening this issue. After taking a look at it, it seems that you are using v5 specific imports with v6 of aws-amplify. For example, AWSCloudWatchProvider
was previously available in v5 but is not available in v6.
I'd recommend taking a a look at the migration guide here.
Additionally, also note that the ConsoleLogger is now imported from aws-amplify/utilites
and not @aws-amplify/core
- documentation.
import { ConsoleLogger } from 'aws-amplify/utils';
Let me know if you have any questions.
Hi @cristobalbl86 thank you for opening this issue. After taking a look at it, it seems that you are using v5 specific imports with v6 of aws-amplify. For example,
AWSCloudWatchProvider
was previously available in v5 but is not available in v6.I'd recommend taking a a look at the migration guide here.
Additionally, also note that the ConsoleLogger is now imported from
aws-amplify/utilites
and not@aws-amplify/core
- documentation.import { ConsoleLogger } from 'aws-amplify/utils';
Let me know if you have any questions.
Thank you @nadetastic for the feedback, I already updated my imports. But I still see that the ConsoleLogger in v6 supports the addPluggable method which receives a LoggingProvider parameter. What should I pass there if AWSCloudWatchProvider is not supported?, my goal is to push the logger logs to CloudWatch. Can you point me to any sample in v6? I was checking your docs but still don't find anything that can unblock me.
I will appreciate any additional feedback.
Hi @cristobalbl86, following up here, thank you for your patience.
V6 doesn’t currently support CloudWatch, and we are working to get this addressed - however I am unable to provide an ETA at this time. In the meantime, a workaround could be to use the AWS SDK (as seen here) to emit the logs yourself.
I’ve marked this as a feature request and will provide any future updates here, but let me know if you have any additional questions.
For anyone that is following this issue, we will be consolidating the context and feedback detailed here into issue #13336 to better focus our efforts on an implementation strategy for improving CloudWatch support in v6. Please leave any additional context or feedback on that issue, and follow it for further updates on progress as we make it!
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Analytics
Amplify Version
v6
Amplify Categories
analytics
Backend
Amplify CLI
Environment information
Describe the bug
I'm trying to push Amplify Logger logs to AWS CloudWatch
All configs are done in the AWS account, the logGroup and logsStream. My problem is in the react native app, I found this way but the AWSCloudWatchProvider doen't seem to work. Module '"aws-amplify"' has no exported member 'AWSCloudWatchProvider'.ts(2305)
`import { Amplify, AWSCloudWatchProvider } from "aws-amplify"; import { ConsoleLogger as Logger } from "@aws-amplify/core";
import awsmobile from "./src/aws-exports";
Amplify.configure(awsmobile);
const cwLogger = new Logger("cloudwatch", "DEBUG");
cwLogger.addPluggable( new AWSCloudWatchProvider({ logGroupName: "cloudwatchlogs", logStreamName: "cloudwatchstream", region: awsmobile.aws_project_region, }) );
export { cwLogger }; `
And I noticed that you deprecated that provider in this PR: https://github.com/aws-amplify/amplify-js/pull/11830
What is the right way to push the Logger logs to CloudWatch?
Expected behavior
I expect the logger be able to push logs to AWS CloudWatch
Reproduction steps
my app is not able to run, the error comes in the imports section
Code Snippet
Log output
aws-exports.js
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response