Resultaten opslaan van app rebuild commando

AI-generated summary

In a support thread titled ‘Saving results of app rebuild command,’ Jonathan5 asks whether output from the app rebuild command (which includes warnings) is logged anywhere, and if not, how to capture it. He mentions increasing Putty’s scrollback buffer as a temporary fix. neounix suggests using the tee command to simultaneously display and save terminal output, especially useful for shell scripts like launcher, which don’t log to Rails’ production.log. Ghan recommends checking ./launcher logs app and the /var/discourse/shared/standalone/log/rails/production.log file, though neounix clarifies that production.log only captures Rails-related output, not launcher script logs. merefield suggests switching from Putty to Microsoft’s Windows Terminal for better scrollback performance and praises tee as a useful tool. Jonathan5 acknowledges the advice, notes he’s used >>logfile 2>&1 in other contexts, but prefers to stick to documented Discourse commands for now — he’ll try increasing Putty’s scrollback, explore Windows Terminal, and check the logs.

I see some warnings when I rebuild the app but rarely get a chance to read them.

Is this text logged anywhere?

If not, is there a recommended way to do this?

I have just increased putty’s “lines of scrollback” from 2,000 to 20,000 which may be the easy answer.

If you are building on linux and other unix-like systems you may use the tee command.

See Also:

Try ./launcher logs app
Some of the output should be there, but I’m not sure if all of it is saved. You can also find more logs under /var/discourse/shared/standalone/log/rails/ particularly the production.log file.

Because launcher is a shell script and not a Rails application, production.log under the rails directory in the log file logs only Rails info, not shell script info from launcher. It logs all Rails actions, mostly all after the Rails app (Discourse) is running.

The './launcher logs` routine is an alias for $docker_path logs $config which is the docker log.

Hence, to get all the information from all launcher processes from the launcher script, it will be necessary to tee (or use another method) the output to save the output to a file if you want to view the information in the terminal and not redirect the output to a file (redirect STDOUT). If you redirect the output to the file, you will not be able to see the output in the terminal.

This is why the tee command was created, for this purpose :slight_smile:

So, if you want to capture the full output of the launcher script, I recommend you use tee. It works well for this type of thing.

@Jonathan5 Putty? You might want to consider Microsoft’s new(ish) and free open-source Windows 10 Terminal app from the Windows store?

https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab

GitHub: GitHub - microsoft/terminal: The new Windows Terminal and the original Windows console host, all in the same place! · GitHub.

… it’s extremely good! It’s GPU accelerated and scrolling back should not be an issue.

@neounix great tip, I’ve never used that command before! Will add that one to the arsenal. I’ve always just piped, but that gives you best of both worlds.

I’ll look into tee. I use >>logfile 2>&1 in some (non-Discourse) cron jobs.

In either case I’m reluctant to do anything different to the exact commands set out in the how-to guides here.

So for the time being I’ll increase the scroll back in putty and also look into that Microsoft alternative.

I’ll also check out the logs.

Thanks for the advice!