How to manage Nextcloud snap logs

Managing Nextcloud snap logs

Managing Nextcloud snap logs

Nextcloud snap logs

In the event of an issue the Nextcloud logs could help figure out a probable cause. Most activities and actions in Nextcloud are logged. An automated log rotation mechanism within Nextcloud clears and retains the logs regularly to prevent an overflow.

TIP

Apps for viewing logs:
Use your favourite viewer less, more, head, tail, cat, bat or lnav to view logs,

sic. scubamuc >
"less is more, from head to tail with cat or bat but lnav is the way to go! "

  • install lnav → sudo snap install lnav
  • issue command → sudo lnav /var/snap/nextcloud/current/logs/nextcloud.log

issue command in host shell to view nextcloud log with cat

sudo cat /var/snap/nextcloud/current/logs/nextcloud.log

Chosing the correct log level

see setting Nextcloud snap log level

available log levels

  • debug (extremely verbose)
  • info (very verbose)
  • warning (verbose)
  • error (less verbose)
  • fatal (quiet)

Watch Nextcloud snap log (live)

issue command in host shell:

sudo nextcloud.occ log:watch

Truncate logs

Sometimes truncating the logs and waiting for the entry to reappear makes those entries more readable, since truncating the logs removes old entries and reduces overhead. Truncating your logs is preferred to deleting the logs.

issue command in host shell:

sudo truncate -s 0 /var/snap/nextcloud/current/logs/nextcloud.log

Nextcloud snap log locations

  • Logs for Nextcloud: /var/snap/nextcloud/current/logs/nextcloud.log
    • Note that this won’t be the case if you’ve configured a custom data directory, for example somewhere in /media. The nextcloud logs will then be stored on that same directory.
  • Logs for Apache2: /var/snap/nextcloud/current/logs/apache_access.log
  • Logs for Redis: /var/snap/nextcloud/current/logs/redis.log
  • Logs for PHP-FPM: /var/snap/nextcloud/current/logs/php-fpm_errors.log
  • Logs for PHP: /var/snap/nextcloud/current/logs/php_errors.log
  • Logs for Certbot: /var/snap/nextcloud/current/certs/certbot/logs/letsencrypt.log
  • Logs for MySQL: /var/snap/nextcloud/current/logs/mysql_errors.log

Nextcloud snap service logs

Nextcloud snap has several services contained within it. There are four that are most important for upgrade purposes:

  • MySQL (nextcloud.mysql)
  • PHP (nextcloud.php-fpm)
  • Apache (nextcloud.apache)
  • Nextcloud Fixer (nextcloud.nextcloud-fixer)

MySQL log

issue command in host shell:

sudo snap logs -f nextcloud.mysql

PHP log

issue command in host shell:

sudo snap logs -f nextcloud.php-fpm

Apache log

issue command in host shell:

sudo snap logs -f nextcloud.apache

Nextcloud Fixer log

issue command in host shell:

sudo snap logs -f nextcloud.nextcloud-fixer

Nextcloud snap issue debugging script

Run the following command (copy and paste the entire thing into your terminal and press enter). Paste the output into the issue; it’s pre-formatted to be a nice comment, so only make it an attachment if it’s too long to be a comment.

Debugging script

How to revert Nextcloud snap after failed update
No access to the Nextcloud snap - who can help
I would like logs wiki tutorial
Internal server error: "no app in context"
How to manage setup warnings in Nextcloud snap
How to manage failed automatic update in Nextcloud snap
How to manage security brute force protection and throttling in Nextcloud snap
Unable to log in and not able to understand the log in nextcloud/data/
The dreaded generic "Internal Server Error"
How to install Nextcloud snap
[SOLVED] Internal Server Error - The server encountered an internal error and was unable to complete your request. By change system files
Nextcloud snap, welcome - automatic update failed
Nextcloud SNAP install suddenly satuats WAN on connection to github
Page Not Found message on share links - v31.0.8snap1
MySql crashes on startup - Snap installation
Issue with CLAMAV
Android Nextcloud app upload errors
Cookbook and reverse proxy
Delete spreed signaling server account on Nextcloud Snap
Delete spreed signaling server account on Nextcloud Snap
Limiting RAM Use
Limiting RAM Use
Warnung no app in context AppManager::checkAppForUser - can't decode group IDs listed in app's enabled config key: 1 - JSON error (0) No error
Nextcloud planté Résolu
Unable to see added storage of 2TB hdd within System disk free space.
Photos tab groups a JST JPEG under the next month despite EXIF OffsetTimeOriginal=+09:00 — known issue?
Cannot login with correct password and no error message
Snap updated to 32.0.9snap1 and encountering internal server error, reverting does not fix.
Snap updated to 32.0.9snap1 and encountering internal server error, reverting does not fix.
Snap: Can't update, add, or remove apps
temporary 2fa code generated by 2fa admin tools not accepted when client uses it
Nextcloud Snap with Collabora Online - Android problems
Nextcloud Snap Ai message in overwiev
Nextcloud Snap Ai message in overwiev
On Core24 with NC31 and after a snap restore: Missing nextcloud.log
Untrusted Domain message on my Cell phone running tailscale
Intégration suite office Nextcloud Snap
No more Video Thumbnails Nextcloud Snap
Problems installing recognize dependencies
Nextcloud web UI not responding
Let's Encrypt Zertifikat abgelaufen
[SOLVED] Internal Server Error - The server encountered an internal error and was unable to complete your request. By change system files
Nextcloud snap, welcome - missing support template
How-to/FAQ WIKI
101: logging, which logs exist, how to access and understand