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.

  1. In the Editor, add a button labeled "button1" to a page on your site called "Test".
  2. Create an event handler via the Properties & Events panel that runs when button1 is clicked.
  3. Add a console.log message to the event handler, such as “button1 clicked!”.
  4. 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.

  1. Make sure the Wix Logs window is open in your Dashboard.
  1. In your live site, navigate to the Test page you created.

  2. (Optional) Open your browser's developer tools to view console messages in your browser.

  3. Click button1.

    The console message appears in the browser console.

  1. A log is generated and a log of the event appears in the Wix Logs window.

To view details, click the log in the window.

Note For a detailed description of log information, click here.

Was this helpful?
Yes
No