Last updated 26 November 2026. By Paul Badarau.
Rui, a fictional developer, sells tickets for a small theatre. Some visitors leave at the payment step and no error is thrown, so he adds two log lines to the checkout:
Sentry.logger.info('Checkout started', { seats: 2, show: 'friday-late' })
Sentry.logger.warn('Payment declined for order ' + orderId, { reason: 'card_expired', retries: 1 })
The next week he searches the Logs page for declined, filters to warnings, and finds that most declines say card_expired. Nothing was broken, so an error report would have been the wrong tool.
- Start the message with a few fixed words that say what happened, such as
Payment declined. Lines with the same start are easy to find and compare. - Put the one ID you will look for in the message. Search on the Logs page matches the message text and does not read attributes.
- Put the other values in the attributes object: numbers, true or false, and short strings. Monitoring keeps up to 40 attributes per line, with their types.
- Pick the level on purpose. The Logs page shows one level at a time when you filter: trace, debug, info, warning, error or fatal.
- Set
releaseandenvironmentinSentry.init. Every line then shows which build and which environment sent it.
Leave personal data out. Monitoring drops attributes whose names start with user. or client. and header and body attributes, filters values under names such as password, token or email, and redacts emails, tokens and card numbers in the message. A customer's name in free text is not caught, so do not write it there. Messages keep up to 8 KiB, and lines are kept for 7 days.
Every stored log line is one Monitoring event, the same as an error, and the Workspace's 10,000 events a month cover both. A line on every page view, on a site with 300 visits a day, uses 9,000 of them, so log the steps you will read later and leave routine page activity out. A log line at error level is still a log line: it does not open an issue or send an email.
The product page for this is Monitoring.