How to Share an Error Log, Stack Trace or Terminal Output So Someone Can Help

How to Share an Error Log, Stack Trace or Terminal Output So Someone Can Help

"It crashed, here's a screenshot of the terminal" is a common start to a long debugging session. The person helping needs the text: the full error, the stack trace and the command that caused it. Here's how to capture logs and terminal output completely, trim them sensibly, remove secrets, and share them in a form people can work with.

Step 1: capture the full output as text

Copy from the terminal

Save it to a file (better for long output)

# macOS, Linux, Windows Command Prompt: normal output and errors into one file
npm run build > build-log.txt 2>&1

# Also show it on screen while saving (macOS/Linux)
npm run build 2>&1 | tee build-log.txt

# PowerShell: capture every stream
npm run build *> build-log.txt

The 2>&1 part matters: most errors are written to a separate "error" stream, and without it, your file may contain everything except the error.

Browser and app logs

Step 2: keep what matters

A 5,000-line log buries the problem. Keep:

How to read a stack trace (so you share the right part)

TypeError: Cannot read properties of undefined (reading 'email')   <- what went wrong
    at formatUser (src/users/format.js:14:22)                         <- your code: start here
    at Array.map (<anonymous>)
    at listUsers (src/users/list.js:31:18)                            <- your code: the caller
    at Layer.handle (node_modules/express/lib/router/layer.js:95:5)   <- library code

The top line says what happened. The first frames in your files say where. Library frames further down are usually less important, but include them anyway; trimming them is the reader's choice.

Step 3: remove secrets and personal data

Logs often contain tokens in URLs and headers, database connection strings, email addresses, IPs and file paths with your username. Replace them with [REDACTED] before sharing. The full checklist is in how to share a config file safely.

Step 4: share it as a link

  1. Paste the trimmed, redacted log into the code sharing tool.
  2. Choose Plain text (or Bash for shell sessions) and give it a title, such as "npm run build fails after upgrading to Node 22".
  3. Share the link with the command and one sentence of context.

Line numbers let helpers point to "line 212", the raw view lets them copy or download the exact text, and the formatting survives any chat app. Snippets up to 512 KB are supported, which fits very long logs.

A message that gets fast help

Running `npm run build` fails since upgrading Node 20 -> 22.
Log (first error at line 48): https://sshot.online/c/Lg8Tn3q
Environment: macOS 15, Node 22.4, npm 10.8
Already tried: deleting node_modules and reinstalling

When a screenshot helps too

Add a screenshot only when something is visual: an error dialog, a broken page, or garbled characters. For dialogs, follow how to capture and share an error message.

Paste up to 512 KB of text and get a link with line numbers and a raw view. Free, no account.

Share a log or stack trace

Frequently asked questions

How do I share terminal output?

Copy it as text (or save it to a file with output redirection), remove any secrets, and paste it into a code-sharing tool. Send the link along with the command you ran.

How do I save command output to a file?

Add > output.txt 2>&1 to the command on macOS, Linux and Windows Command Prompt to capture both normal output and errors. In PowerShell, *> output.txt captures all streams.

Which part of a stack trace matters most?

The exception type and message, the first lines that point to your own code (not library code), and any "Caused by" sections further down.

Should I send a screenshot of the terminal?

Not for the output itself; it cannot be copied or searched. A screenshot can help only to show something visual, like garbled characters or colours.

Related articles

← All guides