You need to sign in to do that
Don't have an account?
Derrick Abbey 21
No debug logs are being generated in my scratch org
Hi community,
I created a new scratch org for developing a new lightning web component. I'm trying to debug it, but I can't see any debug logs in either the developer console or in settings. I also tried pulling the from the CLI and it says that there aren't any logs. I have set user and Apex class trace flags, but still no logs. I know that the class is being called because it's returning data to the lightning web component. Has anyone else encoutered this problem?
I created a new scratch org for developing a new lightning web component. I'm trying to debug it, but I can't see any debug logs in either the developer console or in settings. I also tried pulling the from the CLI and it says that there aren't any logs. I have set user and Apex class trace flags, but still no logs. I know that the class is being called because it's returning data to the lightning web component. Has anyone else encoutered this problem?
Greetings to you!
Apex debug logs can record database operations, system processes, and errors that occur when executing a transaction or running unit tests in your scratch org. You can use the Salesforce CLI to view the debug logs.
1. Open your scratch org by running force:org:open. If you have not set a default username, specify the scratch org’s username or alias with the -u parameter.
2. Under the quick access menu (Lightning Experience) or your name (Salesforce Classic), click Developer Console. Opening the Developer Console starts a listener that is required by the force:apex:log commands.
3. If necessary, run Apex tests to generate some debug logs.
4. Get a list of the debug logs.
5. View a debug log by passing its ID to the force:apex:log:get command.
Please refer to the below links which might help you further.
https://developer.salesforce.com/blogs/2019/02/debug-your-lightning-web-components.html
https://www.mattgoldspink.co.uk/debugging-lwc-tests-vs-code/
https://developer.salesforce.com/docs/component-library/documentation/lwc/debug_intro
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
What I ended up doing is creating a separate user and logging in as that user. Now, when I open the developer console as that user, I can see logs generated as I access the class.
Does that mean that there's something about the default admin user that's created using a scratch org where that user won't generate logs?