How to log more than 300 lines of the OctoPrint terminal?
Yes, you can show more than 300 lines in the terminal; just disable auto scrolling (reference).


  Disabling Autoscroll now completely disables cutting off the lines (so
  you can have way more than 300 lines while that's disabled), filtering
  has been improved too and doesn't cause scrolling anymore.


Note that with disabled autoscrolling, you will be able to see more lines up to the point that the buffer is full. If you need even more lines to monitor, just enable the logging the data to file serial.log. If you open the options page (OctoPrint Settings), just tick the box for "Log communication to serial.log" under "Serial logging" of the "Serial connection" options.

This serial logging file is typically used for debug purposes, but as can be read from the options, it comes with a warning:


  While this can negatively impact performance, a serial.log can be
  incredibly useful for debugging any issues observed in the
  communication between OctoPrint and your printer.


You can either access the log file through the OctoPrint options/setting through the "Logging" options tab, or direct download/copy from the logging directory:


  
  on Linux: ~/.octoprint/logs
  on Windows: %APPDATA%\OctoPrint\logs
  on MacOSX: ~/Library/Application Support/OctoPrint/logs