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/
1 like

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?

Very good, but the subsequent message explained why that isn’t the solution. Since that topic I’d just increased Putty’s history size, and that had been sufficient until today. I’ll try the commands above next time. Thank you.

I’d recommend either /tmp/filename or ~/filename. The tilde is your home directory, which is /root for root. In /tmp they’ll get deleted automatically at some point.

/home is really for user’s home directories. If you

1 like

Cool…

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

… it is then!

1 like