aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.36k stars 2.1k forks source link

Support for CloudWatch provider logger in Amplify v6+ #13336

Open muvashi opened 2 weeks ago

muvashi commented 2 weeks ago

Is this related to a new or existing framework?

No response

Is this related to a new or existing API?

No response

Is this related to another service?

No response

Describe the feature you'd like to request

For adding logging statements, the following are the documentation:-

[+] JavaScript v5 :- https://docs.amplify.aws/javascript/prev/build-a-backend/utilities/console-logger/ [+] Newest JavaScript v6 :- https://docs.amplify.aws/javascript/build-a-backend/utilities/console-logger/

The requirement is to use CloudWatch provider logger in Amplify Gen2. Gen2 backend is only supported with Amplify JavaScript v6+ but v6+ does not support adding CloudWatch provider.

Sample code :-

"use client";

import { Amplify, AWSCloudWatchProvider, Logger } from "aws-amplify";

import config from "@/amplifyconfiguration.json";

Amplify.configure(config, { ssr: true });

const logger = new Logger('ComUI', 'DEBUG')
Amplify.register(logger)
logger.addPluggable(new AWSCloudWatchProvider({
    logGroupName: 'COM',
    logStreamName: 'ComUI',
    region: config.aws_project_region,
}))

export default function ConfigureAmplifyClientSide() {
    return null;
}

Describe the solution you'd like

Support CloudWatch provider logger with Amplify Gen2

Describe alternatives you've considered

NA

Additional context

No response

Is this something that you'd be interested in working on?