Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to Set Up Custom Logging and Monitor App Events in Bubble

Bubble's built-in server logs have limited retention, so building a custom logging system gives you full control over monitoring your app. This tutorial shows how to create a Log Data Type, record events from workflows, categorize logs by severity, filter and search logs in an admin dashboard, and set up alerts when errors occur so you catch issues before your users report them.

What you'll learn

  • How to create a Log Data Type for recording app events
  • How to log workflow steps and errors from any part of your app
  • How to build an admin dashboard for filtering and searching logs
  • How to set up automated alerts when critical errors are logged
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner7 min read20-25 minAll Bubble plansMarch 2026RapidDev Engineering Team
TL;DR

Bubble's built-in server logs have limited retention, so building a custom logging system gives you full control over monitoring your app. This tutorial shows how to create a Log Data Type, record events from workflows, categorize logs by severity, filter and search logs in an admin dashboard, and set up alerts when errors occur so you catch issues before your users report them.

Overview: Custom Logging in Bubble

This tutorial walks you through building a custom event logging system for your Bubble app. Bubble's built-in server logs retain data for only 6 hours on the Free plan, so a custom system gives you permanent records of important events, errors, and user actions that you can filter, search, and analyze.

Prerequisites

  • A Bubble app on any plan
  • Basic understanding of Bubble Data Types and Workflows
  • Familiarity with the Workflow tab and backend workflows
  • An admin page or section in your app for viewing logs

Step-by-step guide

1

Create the Log Data Type

Go to the Data tab and create a new Data Type called 'AppLog'. Add the following fields: 'event_type' (text — values like 'info', 'warning', 'error', 'debug'), 'message' (text — description of what happened), 'source' (text — which page or workflow generated the log), 'user' (User — the user who triggered the event, if applicable), 'details' (text — additional context or error messages), and 'severity' (number — 1 for debug, 2 for info, 3 for warning, 4 for error). The auto-generated Created Date field serves as your timestamp.

Pro tip: Create an Option Set called 'LogLevel' with options Debug, Info, Warning, Error for cleaner filtering instead of free-text severity values.

Expected result: An AppLog Data Type exists with fields for event type, message, source, user, details, and severity.

2

Add logging actions to your workflows

In any workflow where you want to record an event, add a Create a new thing → AppLog action. Set the fields: event_type to the appropriate level, message to a description of the event, source to the page or workflow name, and user to Current User. For error logging, use the 'An unhandled error occurs' event. Create a workflow for this event and log Current workflow error's message and Current workflow error's code. For important user actions like signups, purchases, or data changes, add an AppLog creation step in the relevant workflow.

Expected result: App events and errors are automatically recorded as AppLog entries in your database.

3

Build the log viewer admin dashboard

Create a new admin page for viewing logs. Add filter controls: a Dropdown for event_type, a Date Range picker for time filtering, and a Search Input for text search. Below the filters, add a Repeating Group with type AppLog. Set the data source to Do a Search for AppLog with constraints matching your filter values. Display columns for timestamp (Created Date), event type, message, source, and user. Add color-coded badges for event types — red for error, yellow for warning, blue for info, gray for debug. Sort by Created Date descending so newest logs appear first.

Expected result: An admin dashboard displays logs in a filterable table with color-coded severity levels.

4

Set up automated error alerts

Create a backend workflow called 'check_error_alerts'. Use a database trigger event: When an AppLog is created and event_type is 'error'. Inside this trigger, add an action to send an email notification to your admin email address. Include the error message, source, timestamp, and user in the email body. You can also send a Slack notification via webhook using the API Connector if your team uses Slack for monitoring. For rate limiting, add a condition that only sends alerts if fewer than 5 error alerts have been sent in the last hour to avoid notification flooding.

Pro tip: Use a separate 'AlertSent' Data Type to track when alerts were sent, preventing duplicate notifications for the same recurring error.

Expected result: When a critical error is logged, your team receives an email or Slack notification within seconds.

5

Implement log cleanup to manage database size

Logs accumulate quickly and can bloat your database. Create a scheduled backend workflow called 'cleanup_old_logs' that runs daily. Inside it, search for AppLog entries where Created Date is older than 30 days (or your preferred retention period) and event_type is not 'error'. Delete these records using a Schedule API Workflow on a List action to process them in batches. Keep error logs for 90 days or longer for debugging historical issues. You can also archive old logs by exporting them before deletion.

Expected result: Old non-critical logs are automatically cleaned up, keeping your database lean while preserving important error records.

Complete working example

Workflow summary
1CUSTOM LOGGING SYSTEM SUMMARY
2=====================================
3
4DATA MODEL:
5 AppLog Data Type:
6 - event_type (text): info, warning, error, debug
7 - message (text): event description
8 - source (text): page/workflow name
9 - user (User): who triggered it
10 - details (text): additional context
11 - severity (number): 1=debug, 2=info, 3=warning, 4=error
12 - Created Date (auto): timestamp
13
14 Optional: LogLevel Option Set
15 Debug, Info, Warning, Error
16
17LOGGING WORKFLOWS:
18 User action logging:
19 Workflow step Create new AppLog
20 event_type: 'info'
21 message: 'User completed purchase'
22 source: 'checkout_page'
23 user: Current User
24
25 Error logging:
26 Event: An unhandled error occurs
27 Create new AppLog
28 event_type: 'error'
29 message: Current workflow error's message
30 details: Current workflow error's code
31 source: 'workflow_name'
32 user: Current User
33
34ADMIN DASHBOARD:
35 Filters:
36 Dropdown: event_type
37 Date Range: Created Date
38 Search Input: message contains
39 Repeating Group: AppLog
40 Sort: Created Date descending
41 Columns: timestamp, type (color badge), message,
42 source, user
43 Color badges:
44 error red
45 warning yellow
46 info blue
47 debug gray
48
49ALERTS:
50 Database trigger: AppLog created + type = error
51 Send email to admin
52 Or: API Connector Slack webhook
53 Rate limit: max 5 alerts per hour
54
55CLEANUP:
56 Scheduled backend workflow: daily
57 Delete AppLogs older than 30 days
58 Except: event_type = error (keep 90 days)
59 Process in batches via Schedule on a List

Common mistakes when setting up Custom Logging and Monitor App Events in Bubble

Why it's a problem: Logging too many events without considering WU costs

How to avoid: Log only meaningful events — errors, important user actions, and key workflow completions. Use debug-level logging only during development.

Why it's a problem: Not implementing log cleanup

How to avoid: Schedule a daily backend workflow to delete logs older than your retention period

Why it's a problem: Placing log creation actions at the beginning of workflows

How to avoid: Place log creation actions at the end of workflows or use Schedule API Workflow to log asynchronously

Best practices

  • Use consistent event type values across your entire app for easy filtering
  • Include the source page or workflow name in every log entry
  • Color-code log severity levels in your admin dashboard for quick scanning
  • Set up email or Slack alerts for error-level events
  • Implement log retention policies to prevent database bloat
  • Log asynchronously using backend workflows to avoid blocking user-facing actions
  • Keep error logs longer than informational logs for debugging purposes

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I want to build a custom logging system in my Bubble.io app that records errors, user actions, and API call results. How should I structure the Data Type and where do I add logging actions?

Bubble Prompt

Help me create a logging system for my app. I need a Log data type, error capture from workflows, and an admin page to view and filter logs by type and date.

Frequently asked questions

How long does Bubble keep its built-in server logs?

Bubble retains server logs for 6 hours on the Free plan. Paid plans have longer retention. A custom logging system gives you permanent records.

Will custom logging slow down my app?

Each log entry is a database write (about 0.5 WU). For most apps, this is negligible. If you log many events, use backend workflows for asynchronous logging.

Can I view logs from a specific user?

Yes. Add the User field to your AppLog Data Type and filter by user in your admin dashboard. This is useful for debugging user-reported issues.

How do I log API call failures?

In the API Connector, enable 'Include errors in response.' In your workflow, check if the API response contains an error and create an AppLog with the error details.

Should I log successful actions or just errors?

Log both, but at different severity levels. Use 'info' for important successes like purchases and signups, and 'error' for failures. Avoid logging routine actions that happen thousands of times daily.

Can RapidDev help set up monitoring for my Bubble app?

Yes. RapidDev can build comprehensive logging and monitoring systems including error tracking, user activity logging, and automated alerting for your Bubble application.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.