Skip to content

Impossible to hide AWS chime logs in console

0

I am using AWS Chime SDK to host/record/transcribe video calls. I am using the node packages "amazon-chime-sdk-component-library-react" & ''amazon-chime-sdk-js' for components and functionality. The calls themselves work perfectly however, there are huge amount of logs coming through the console which I am unable to turn off and seem to slow performance. I have tried LogLevel.OFF when constructing the ConsoleLogger object and even tried using the noOps Logger but nothing is working. Any advice would be greatly appreciated!

asked 2 years ago235 views

3 Answers
0

I understand your frustration with the excessive logging in the AWS Chime SDK. While it's not impossible to control the logs, it seems you've encountered some challenges. Let's explore some options to address this issue.

First, it's important to note that you're on the right track by trying to adjust the log level. The Amazon Chime SDK does provide ways to control logging, and setting the log level to OFF should theoretically stop the console logs.

Here's what you can try:

  1. Double-check your implementation of the ConsoleLogger. Make sure you're passing LogLevel.OFF correctly:

const logger = new ConsoleLogger('MyLogger', LogLevel.OFF); const meetingSession = new DefaultMeetingSession(configuration, logger, deviceController);

  1. If you're still seeing logs after setting LogLevel.OFF, it's possible that logs are coming from other parts of the SDK or your application. In this case, you might want to try using a custom logger that doesn't output anything. You can create a simple no-op logger like this:

const noOpLogger = { info: () => {}, warn: () => {}, error: () => {}, debug: () => {} };

const meetingSession = new DefaultMeetingSession(configuration, noOpLogger, deviceController);

  1. If you're concerned about performance, you might want to consider using the POSTLogger instead of the ConsoleLogger. The POSTLogger can send logs to your backend (like Amazon CloudWatch Logs) instead of the browser console, which might help with client-side performance.

  2. Make sure you're using the latest version of the Amazon Chime SDK. There might have been improvements or bug fixes related to logging in newer versions.

  3. If none of these solutions work, it's possible that there's an issue with the SDK itself. In this case, you might want to reach out to AWS support or check the SDK's GitHub repository for any known issues or discussions about logging.

Remember, while logging is important for debugging and monitoring, it shouldn't significantly impact the performance of your application. If you're noticing severe performance issues, there might be other factors at play beyond just the logging.

If you continue to face issues after trying these suggestions, consider gathering more detailed information about the logs you're seeing (without including any sensitive data) and reaching out to AWS support for further assistance.
Sources
Setting up logging and monitoring - Amazon Chime SDK
Logging and monitoring in the Amazon Chime SDK - Amazon Chime SDK

answered 2 years ago

0

Hello,

to add to the above, if logs are still coming through, you can try to:

  • override the console methods temporarily:
const originalConsoleLog = console.log;
const originalConsoleWarn = console.warn;
const originalConsoleError = console.error;

console.log = () => {};
console.warn = () => {};
console.error = () => {};

// Your Chime SDK code here

// Restore original console methods when done
console.log = originalConsoleLog;
console.warn = originalConsoleWarn;
console.error = originalConsoleError;
  • When creating your MeetingSessionConfiguration, set the log level to OFF:
import { LogLevel } from 'amazon-chime-sdk-js';

const configuration = new MeetingSessionConfiguration(meetingResponse, attendeeResponse);
configuration.logLevel = LogLevel.OFF;
  • Ensure that your browser's developer tools are not set to preserve logs between page reloads, which might give the impression of persistent logging.

If none of these solutions work, you may want to reach out to AWS support or file an issue on the Amazon Chime SDK GitHub repository for further assistance Best

AWS

answered 2 years ago

0

This is a very late answer, but maybe relevant to someone searching for a solution today. The react components create a default MeetingManager when you use the MeetingProvider. In creating the MeetingManager, it creates a ConsoleLogger with the level set to LogLevel.INFO. This gets passed to the AWS Javascript SDK components, and those do a huge amount of logging.

We were able to dramatically reduce the logging by doing the following:

                            <MeetingProvider
                                meetingManager={
                                    new MeetingManager(
                                        new ConsoleLogger(
                                            'our-meeting-logger',
                                            LogLevel.OFF,
                                        ),
                                    )
                                }
                            >
                                <OurComponent {...props} />
                            </MeetingProvider>

We still saw at least one log, but the vast majority were gone after this. Probably mileage will vary based on your use of the providers and react components.

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.