# Sharing logs

Pasting log lines into a GitHub issue, a vendor's support ticket or a chat usually means a screenshot or a block of
copied text. Share gives you a link instead: a read-only page with a copy of the lines, secrets masked, that anyone
with the link can open without a Tailcove account. It stops working when it expires or when you revoke it.

## Make a link

Open a source's **Logs** tab. There are two ways to share:

- **The search on screen.** Press **Share** next to the time range. The link holds what the search matches in that
  range, newest first, up to 500 lines. If the search matches more, you get the newest 500 and the dialog says so.
- **One line and its neighbours.** Open a line and press **Share this line**. The link holds that line and up to 25
  lines either side of it from the same source, by time, with the line itself highlighted.

Pick how long the link works (1 hour, 24 hours, 7 days or 30 days; 7 days if you don't change it) and give it a title
if you like. **Create link** shows the link once, with a copy button. We only keep a hash of it, so we can't show it
to you again; if you lose it, make a new one.

Anyone on the team who can read the source can share it, Viewers included. A member restricted to some client groups
can only share the sources they can see. The Billing role can't share.

## What the page shows

The title, the source and team names, when the link was made and when it stops working, then the lines in the same
layout as the Logs tab. Click a line to see its context as JSON. There's no search on the page and nothing on it links
into the app.

The page is a snapshot. It's written when you make the link, so lines that age out of retention or get deleted later
are still on it, and new lines never show up. If you need fresh lines, make a new link.

## Masking

Every line is masked before the copy is written, with the same recommended rules a new source starts with: values
under keys like `password`, `token`, `api_key`, `authorization` and `cookie`, bearer and basic credentials, known key
shapes (JWTs, AWS, Stripe, GitHub, Slack and Google keys, private key blocks) and card numbers become `[redacted]`,
`[token]`, `[key]` or `[card]`. This happens even if the source has recommended masking switched off, because a link
leaves your hands as soon as you paste it somewhere.

Masking catches the usual suspects, not everything. Emails and IP addresses are left as they are, and so is anything
your app logs under a key name we don't recognise. Read the page before you send the link.

A long message is cut at 16 KB, and a context bigger than 16 KB is left out with a note.

## Revoke a link

**Shared links** in the sidebar lists the team's links that still open: title, source, who made it, how many lines,
how often it was opened and when it stops working. **Revoke** stops a link at once and deletes its copy. The person who
made a link can revoke it, and so can owners and admins.

Expired and revoked links are cleaned up every day.

## Turn links off for the team

Owners and admins can switch **Public log links** off under **Settings → Teams**. While it's off, the Share buttons
are gone, no new link can be made, and every existing link answers "not found". Turn it back on and the links that
haven't expired or been revoked work again.

The team's IP allow-list doesn't apply to these pages. That's what makes them shareable: whoever has the link can
read it from anywhere. If your team can't have that, switch links off.

## Limits

A team can have 5 open links on Free, 100 on Pro and 1,000 on Business. Expired and revoked links don't count. Making
a link, revoking one and changing the team setting are all in the audit log.

## Privacy

Shared pages ask search engines not to index them, aren't cached, and don't send the link on as a referrer when
someone clicks away. Opening the same link many times from one address is rate limited. Still, treat a link like the
lines on it: anyone you forward it to can read them until it expires.
