brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: occ log:watch follows the Nextcloud log live in your terminal

Nextcloud
~/tips/tip-nextcloud-log-watch

docker exec -it --user www-data nextcloud php occ log:watch

Shows new log entries while you reproduce a problem.

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

More Nextcloud tips sudo -E -u www-data php occ user:report sudo -E -u www-data php occ app:update --showonly sudo -E -u www-data php occ background-job:history -s 3 -l 10 docker exec --user www-data nextcloud php occ maintenance:mode --on docker exec -it --user www-data nextcloud php occ user:resetpassword layla All Nextcloud tips (13) All topics

Link