Save output of rebuild to log file

I use Putty on Windows 10 to rebuild Discourse, then copy the text from Putty to the clipboard, then to a notes app for reference, in case something goes wrong. The upgrade to 2025.12.0-latest produced too much text for the Putty history, and even that was too much for the clipboard.

I’d like to start saving the log to a file instead. Is there a recommended directory to save the log file, and would the following work with the Discourse rebuild?

cd /var/discourse
./launcher rebuild app 2>&1 | tee filename.log

AFAIK, There is no official required directory for storing these kinds of logs, but you should avoid cluttering system or app directories. Common locations include:

  • Your user’s home directory (/home/yourusername/)
  • /var/discourse/ itself (if you have write privileges), for temporary logs. A custom log directory you create, such as /var/discourse/logs/

Thank you. I log in as root so there aren’t subdirectories within home but I’ll try this next time:

cd /var/discourse
./launcher rebuild app 2>&1 | tee /home/filename.log

Hmm, I see that you asked something similar a few years ago, perhaps this?