consoleOut
property is a log output generated by customers within the Auth0 platform through Actions, Rules, Hooks, Extensions, and DB Scripts. Auth0 recommends using the consoleOut
property for testing and debugging purposes only. You should not log personal data or other sensitive data into the web console or the log output will include such data.console.log
facility. To learn more, read console.log() in MDN Web Docs. There is no interactive debugging of a rule available within the Auth0 platform (though one could employ the testing automation technique described below in conjunction with some external interactive source-debugging facility; to learn more, read Rules Testing Best Practices).
//
) or block (i.e., /* */
) comments to a rule, particularly around non-obvious functionality, is invaluable to both code debugging and also code understanding, particularly as there are many occasions where the initial implementer of a rule may not be the same person responsible for maintaining it going forward.
console.log
output, console.error
output, and console.exception
output. To learn more, read console.error() in MDN Web Docs.
DEBUG
environment configuration variable has been created, which can be set to true
or false
depending on the execution environment (e.g., production, testing, development). The setting of this variable is used to determine when debug logging is performed. Further, a DEBUGLEVEL
environment configuration
variable, say, could be created, which could be used to control the debugging log level (e.g., verbose, medium, sparse).
The above example also demonstrates declaration of a named function. For convenience, providing a function name—using some compact and unique naming convention—can assist with diagnostic analysis. Anonymous functions make it hard in debugging situations to interpret the call-stack generated as a result of any exceptional error condition and providing a unique function name addresses this. To learn more, read Error Handling Best Practices.