Something fails in the web interface with a vague message. The useful part is in the log, and you can watch it arrive while you click.
Start the watcher in one terminal:
docker exec -it --user www-data nextcloud php occ log:watch
Then repeat the action that went wrong in your browser. New entries show up as they are written, formatted for reading, which beats tailing a file full of long JSON lines. Stop with Ctrl+C.
If the problem already happened, the sibling command prints the most recent entries and exits:
docker exec -it --user www-data nextcloud php occ log:tail
Both need the Log Reader app to be enabled. It ships with a normal install, and if the commands are missing, check with occ app:list.
When the log is too quiet to explain anything, you can raise the detail for a single command by setting NC_loglevel=0 in its environment, which the manual mentions for debugging. Changing the level for the whole server is a config setting, and debug logging is noisy, so turn it back down afterwards.
One thing I’d remember: log lines can contain usernames, file names and client addresses. Strip those before pasting a snippet into a forum post or an issue.
Further reading: Nextcloud occ system commands, Nextcloud occ command
Going deeper: Guide: put Nextcloud behind Nginx Proxy Manager with HTTPS and the right headers