In addition to capturing your application’s standard logs, JS exceptions & Network errors, Zipy allows you to log custom messages, JS exceptions and application errors to enable you to capture messages & issues that may be specific to your application.
To enable that, Zipy supports three different methods in its SDK.
- zipy.logMessage
- zipy.logException
- zipy.logError
Let’s look at the method signature, sample usage and Zipy App views for each of these methods to understand how to use them in your application to make your troubleshooting even more effective.
zipy.logMessage(message, [info])
Capture custom messages and report to Zipy with this method.
Following are the Method Parameters:
Example usage:
// Script window.zipy.logMessage('Something went wrong', { module: 'Auth module' })
// NPM zipy.logMessage('Something went wrong', { module: 'Auth module' });
How can I view custom logged messages in the Zipy App?
All your custom logged messages will be visible in the Zipy App’s Error Context & Session Context screen’s “Zipy Logs” tab in Dev Tools as indicated by this screen grab:
zipy.logException(error)
Log Javascript Exceptions at any point in your application code and report to Zipy
Following are the Method Parameters:
Example usage:
A common usage of this method would be after you encounter buggy code in a try...catch block. zipy.logException could be used in the catch block to log the exception that you can
// Script try { buggyCode(); } catch (err) { window.zipy.logException(err); }
// NPM try { buggyCode(); } catch (err) { zipy.logException(err); }
How can I view custom logged exceptions in the Zipy App?
All your custom logged Exceptions will be visible as normal Javascript Exceptions in the Error dashboard as well as the Zipy App’s Error Context & Session Context screen’s “Stack trace” tab in Dev Tools.How can I search for custom logged exceptions in the Zipy App?
You can use Zipy’s Advanced Filtering to search for custom logged exceptions just like you would search for other Javascript Exceptions.zipy.logError(errorType, errorMessage, [category], [errInfo])
Log your custom application errors with your custom Error Name and Error MessageFollowing are the Method Parameters:
Example usage:
The usage of this method depends on your application code. You may want to log an error that is not a standard Javascript exception or Network error, but is important for your application.
E.g.: If your application Frontend code has requested a user operation to your Backend via an API call, the Backend might be responding with a 200 OK response, but indicating to the Frontend in the response body that the delete has failed. It would be useful to capture this failure which can be done with the zipy.logError method
// Script //xhr call to Backend //check response code //use zipy.logError window.zipy.logError(“APIFailure”, “Delete project failed”, { failed_project_ids: [34, 67, 88] })
// NPM //xhr call for delete //check response code //use zipy.logError zipy.logError(“APIFailure”, “Delete project failed”, { failed_project_ids: [34, 67, 88] })
How can I view custom logged errors in the Zipy App?
All your custom logged Errors will be visible as normal Javascript Exceptions in the Error dashboard as well as the Zipy App’s Error Context & Session Context screen’s “Zipy Logs” tab in Dev Tools a shown by the screen grabs below:How can I search for custom logged errors in the Zipy App?
You can use Zipy’s Advanced Filtering to search for custom logged errors based on the Error Type and the Error Message that you provided. Use the “Error Type” and “Error Context” filters in the Error filtering to look for your custom Error Type and custom Error Message respectively.Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article