Bancha 1: Error Handling and Logging¶
Note: This is the documentation for Bancha 1. You can find the current documentation here.
Error Handling in CakePHP¶
Error Handling in the Browser¶
In production mode all client-side errors will automatically be logged to the CakePHP log file js_error.log, including the full stack trace. In debug mode Bancha does not provide an error handler for the client, this make debugging easier for you.
You will often want to log some information to the console in debug mode. For this you can use Bancha.Logger.info(msg), which abstracts the console.
If you want to log warning and errors, use Bancha.Logger.warn(msg) and Bancha.Logger.error(msg). In debug mode these will be logged to the console, in production mode these errors will be logged to the CakePHP log file js_error.log. This works out if the box. If you want the force Bancha to log it to the server, set the second argument to true: Bancha.Logger.error(msg, true);