Gravity
Search…
Gravity
Welcome to Gravity
Getting Started
Stack
Updates
Changelog
Gravity Server
Introduction
Installation
Application Structure
REST API
Authentication
Config
Environment Variables
Database Queries
Handling Errors
Logging
Push Notifications
Email Notifications
User Feedback
Permissions (Roles)
File Uploads
Payments
Free Accounts
CLI Toolbelt
Testing
Gravity Web
Introduction
Tailwind & SCSS
Routing
Events
Authentication
Hooks
Views
Handling Errors
Deployment
Components
Gravity Native
Introduction
Prerequisites
Installation
App Context
Authentication
Magic Links
Handling Errors
Navigation
Config
Events
Views
Components
Push Notifications
Payments
Building Your App
Mission Control
Introduction
Installation
User Management
Feedback
Events
Logs
Powered By
GitBook
Logging
Gravity comes with a built-in logging tool that logs errors by default and allows you to record your own custom logs.
1
log
.
create
(
message
,
body
,
req
,
sendNotification
,
user
,
account
);
Copied!
You can pass 6 parameters to the log model:
Parameter
Type
Description
message
string
description of log
body
json or error object
full error or response object
req
request object
the model will extract the URL, HTTP method,
user_id
and
account_id
from the request.
sendNotification
true or false
Determines if an email should be sent to you as soon as an error occurs (default: false)
user
string
user ID to override the request object (or if not present in request)
account
string
account ID to override the request object
View Application Logs
You can see all of your application logs inside the
logs section of Mission Control
.
Gravity Server - Previous
Handling Errors
Next - Gravity Server
Push Notifications
Last modified
4mo ago
Copy link
Contents
View Application Logs