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

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

I would like logs wiki tutorial
Nextcloud snap, welcome - missing support template
No access to the Nextcloud snap - who can help
How to revert Nextcloud snap after failed update
How-to/FAQ WIKI
101: logging, which logs exist, how to access and understand
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/
Problems installing recognize dependencies
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
The dreaded generic "Internal Server Error"
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