Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Server

Logging

Gravity comes with a built-in logging tool that logs errors by default and allows you to record your own custom logs.

log.create({ message, body, req, sendNotification, user, account });

You can pass 6 parameters to the log model:

ParameterTypeDescription
messagestringdescription of log
bodyjson or error objectfull error or response object
reqrequest objectthe model will extract the URL, HTTP method, user_id and account_id from the request.
sendNotificationtrue or falseDetermines if an email should be sent to you as soon as an error occurs (default is false)
userstringuser ID to override the request object (or if not present in request)
accountstringaccount ID to override the request object

View Application Logs

You can see all of your application logs inside the logs section of Mission Control.