@@ -30,6 +30,7 @@ helm install my-release nextcloud/nextcloud
3030 * [ Downloading models for recognize] ( #downloading-models-for-recognize )
3131* [ Backups] ( #backups )
3232* [ Upgrades] ( #upgrades )
33+ * [ Troubleshooting] ( #troubleshooting )
3334
3435## Introduction
3536
@@ -485,3 +486,63 @@ After an upgrade, you may have missing indices. To fix this, you can run:
485486# where NEXTCLOUD_POD is *your* nextcloud pod
486487kubectl exec -it $NEXTCLOUD_POD -- su -s /bin/sh www-data -c "php occ db:add-missing-indices"
487488```
489+
490+ # Troubleshooting
491+
492+ ## Logging
493+ The nextcloud instance deployed by this chart doesn' t currently create a log file locally inside the container.
494+ Examples scenarios to change this behavior include:
495+ - Triaging mailserver issues
496+ - Any time you' re confused by server behavior and need more context
497+ - Before submitting a GitHub Issue (you can include relevant log messages that way)
498+
499+ ### Changing the logging behavior
500+ To change the logging behavior, modify your `logging.config.php` in your `values.yaml` under the `nextcloud.configs` section like so:
501+ ```yaml
502+ nextcloud:
503+ configs:
504+ logging.config.php: |-
505+ <?php
506+ $CONFIG = array (
507+ ' log_type' => ' file' ,
508+ ' logfile' => ' nextcloud.log' ,
509+ ' loglevel' => 0,
510+ ' logdateformat' => ' F d, Y H:i:s'
511+ );
512+ ```
513+ `loglevel` corresponds to the detail of the logs. Valid values are:
514+ ```
515+ 0: DEBUG: All activity; the most detailed logging.
516+
517+ 1: INFO: Activity such as user logins and file activities, plus warnings, errors, and fatal errors.
518+
519+ 2: WARN: Operations succeed, but with warnings of potential problems, plus errors and fatal errors.
520+
521+ 3: ERROR: An operation fails, but other services and operations continue, plus fatal errors.
522+
523+ 4: FATAL: The server stops.
524+ ```
525+ [More information about Nextcloud logging](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html)
526+
527+ ### Viewing the logs
528+ To view logs after changing the logging behavior, you can exec into the Kubernetes pod, or copy them to your local machine.
529+
530+ #### Exec into the kubernetes pod:
531+ ```bash
532+ kubectl exec --stdin --tty nextcloud-pod-name-random-chars -- /bin/sh
533+ ```
534+
535+ #### Then look for the `nextcloud.log` file with tail or cat:
536+
537+ ```bash
538+ cat nextcloud.log
539+ tail -f nextcloud.log
540+ ```
541+
542+ #### Copy the log file to your local machine:
543+ ```bash
544+ kubectl cp default/nextcloud-pod-name-random-chars:nextcloud.log ./my-local-machine-nextcloud.log
545+ ```
546+
547+ ### Sharing the logs
548+ Remember to anonymize your logs and snippets from your pod before sharing them with the internet. Kubernetes secrets, even Sealed ones, live in plaintext `env` variables on your running containers, and log messages can include other information that should stay safely with you.
0 commit comments