Documentation / Using CloseYourIt
Logs
Search your apps' messages, follow a request from start to end and link a message to an error or a ticket.
Logs are the messages your apps write while they run: information, warnings, errors. Logs collects them all in one list, to search when something does not add up. They come from the SDKs or from OpenTelemetry.
Unlike errors, logs are not grouped and not resolved: they are a list in time order, to read and filter.
What a message looks like
Each message has:
- a level: debug, info, warning, error or fatal;
- the Message, that is the text;
- the Attributes: name-value pairs your app adds, for example
order_idoruser_plan; - the Context: project, environment, release and the logger that wrote it;
- if present, the request identifier (trace id): a code shared by everything that happens during the same request.
Apps only send the levels they are configured for. If you filter a level the app never sent, the list stays empty: the minimum level is set in the SDK.
Search for a message
- Open Logs.
- Type a word of the message in the search, or paste a request identifier.
- Narrow down with the Level, Environment and Project filters.
The How many messages, and when chart shows the volume over time and how many messages are alarming. Click a bar to look at that period only; Back to the whole period undoes it.
To see how many times the same text appears, group by Similar message: each row says when it appeared first and last.
From the command line:
cyi logs list --project acme-api --level error
cyi logs show <id>
Follow a request
When a message carries the request identifier, CloseYourIt links it by itself to everything that happened in the same request. You do not have to do anything.
- On a message page, This request lists the other logs of the same request, and Errors of this request the errors.
- On an error page, the Logs of this request tab shows the logs written while it happened. View all logs of this request opens the filtered list.
Standard Rails and background job messages are recognized automatically. For the others, send the identifier as the trace id together with the log.
cyi logs list --trace-id <trace-id>
Link a message to an error or a ticket
If a message explains an error or a ticket but does not carry the same identifier, link it by hand:
- Open the message.
- In Linked to press Link to error/ticket.
- Search the error by title or the ticket by code or title, then press Link.
The message appears in Linked logs on the error or ticket page. Remove takes the link away.
To open a new ticket from a message, press Open a ticket: it is created already filled in from the text. If that message had already become a ticket, it is linked to that one instead of opening another.
Linking and opening a ticket need the "Link a log to a ticket" permission.
cyi logs link <id> --to "Errors::Group:<uuid>"
cyi logs link <id> --to "Ticketing::Ticket:<uuid>"
Get an alert
The Error/fatal log alert rule fires when a message of level error or fatal arrives. How to create it: Alerts.
How long they are kept
Logs are kept for 14 days, then deleted by themselves. To change it for a project, open it, then Settings and Logs retention (days): empty means using the organization's value.