Velo: Generating a Log to Debug Your Site
Console messages (such as console.log()
and console.error()
) in your site code generate logs. These logs appear in the Wix Logs window. Use these logs to debug your site.
Example: Monitoring Button Clicks
Note In the example below we generate a log by running a console message in our page code. You can also generate logs by running console messages from the backend, web modules, public, or anywhere else in your site.
Follow the instructions below to generate a log every time a site visitor clicks a specific button in your site. Or adapt the example to monitor any part of your site.
- In the Editor, add a button labeled "button1" to a page on your site called "Test".
- Create an event handler via the Properties & Events panel that runs when button1 is clicked.
- Add a console.log message to the event handler, such as “button1 clicked!”.
- Publish your site.
Note You can also generate logs when previewing your site, but some log information is available only when you publish your site.
- Make sure the Wix Logs window is open in your Dashboard.
![](https://wixmp-833713b177cebf373f611808.wixmp.com/images/generating-a-log-event-to-debug-your-site-md_velo-articles_developer-tools_images_wix-logs-window-old.png)
-
In your live site, navigate to the Test page you created.
-
(Optional) Open your browser's developer tools to view console messages in your browser.
-
Click button1.
The console message appears in the browser console.
- A log is generated and a log of the event appears in the Wix Logs window.
![](https://wixmp-833713b177cebf373f611808.wixmp.com/images/generating-a-log-event-to-debug-your-site-md_velo-articles_developer-tools_images_site-logs-example-old.png)
To view details, click the log in the window.
![](https://wixmp-833713b177cebf373f611808.wixmp.com/images/generating-a-log-event-to-debug-your-site-md_velo-articles_developer-tools_images_log-information.png)
Note For a detailed description of log information, click here.