Open hisham opened 5 years ago
I asked myself the same question and figured out the following: The AppSync client uses https://www.npmjs.com/package/debug for logging. You can enable the output
localStorage.debug = 'aws-appsync:*'
Cool thanks! I"m using the browser. Tried to set localStorage.debug = 'aws-appsync:*'
in the console but nothing new was being logged. Setting window.LOG_LEVEL = 'DEBUG'
however in the console enabled all other amplify logging...
I didn't set it using the console, but using the DevTools.
There you should be able to add an entry in your local storage with key debug
and value aws-appsync:*
.
Still not working for me :S. Attached is screenshot of my localStorage setting in Chrome DevTools. Still no logs appear in the console.
Strange.
Are you sure you are using the latest version? Logging has been introduced in aws-appsync@1.7.0
.
Yes I am running 1.7.1. I do see the 'debug' package as a dependency in the aws-appsync package inside my node_modules.
@hisham could it be possible that you have some sort of filtering of log messages active?
@greimela instructions are correct and work for me too
can you try also using aws-appsync:*,*
as the value? That should show some other libraries log messages too
Nope nothing outputs and I don't have any filters. You can test the app yourself at https://econsults.seemaeye.com.
Actually running in dev mode (localhost) and with aws-appsync:, produces debug logs from sockjs-client:main:
But I don't see appsync specific logs. And it seems the debug logs are disabled in production deployed version regardless of local storage setting.
Regarding not seeing the messages in prod, I think your bundler might not be including the debug module maybe?
Actually running in dev mode (localhost) and with aws-appsync:, produces debug logs from sockjs-client:main:
I noticed it is missing the '', can you try with `aws-appsync:`
How do you enable this in Expo/React Native?
I've tried in my typescript code to put
import { debug } from 'debug';
debug.enable('aws-appsync:*');
But this doesn't have any effect.
Do you want to request a feature or report a bug? bug
What is the current behavior? Setting
Amplify.Logger.LOG_LEVEL = 'DEBUG';
does not emit any appsync related logs.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Set Amplify.Logger.LOG_LEVEL = 'DEBUG'; and watch the console logs.
What is the expected behavior?
I should be able to see some appsync related logs.
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? Latest versions.