APEX 20.1 on 12.1
The only way that I am aware of to enable debug mode is to run an application from the APEX development environment, and then click 'debug' on the developer toolbar.
An application I have is running into an issue on rendering of the first (login) page where it is logging the user out, and creating a new session ID.
I've tried creating a public page, opening that, clicking 'debug', and then moving to the login page, but the user is getting logged out, and that seems to kill the debugging.
Possible approaches I have thought of are to have the application start up in Debug mode in order to try and find out what is going on in that initial render, or to have all APEX activity on a particular DB or web server occur in debug mode.