Skip to content

Commit

Permalink
Logging documentation update (#443) (#482)
Browse files Browse the repository at this point in the history
* Logging documentation update (#443)

Signed-off-by: Veymax <[email protected]>

* Apply suggestions from code review

Rolling in suggestions

Co-authored-by: JesseBot <[email protected]>
Signed-off-by: Maximilien McDermott <[email protected]>

* Adds linkable titles and syntax highlighting

Signed-off-by: Veymax <[email protected]>

---------

Signed-off-by: Veymax <[email protected]>
Signed-off-by: Maximilien McDermott <[email protected]>
Co-authored-by: JesseBot <[email protected]>
  • Loading branch information
MaximUltimatum and jessebot authored Nov 23, 2023
1 parent 4cb7445 commit 2ee0dd9
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ helm install my-release nextcloud/nextcloud
* [Downloading models for recognize](#downloading-models-for-recognize)
* [Backups](#backups)
* [Upgrades](#upgrades)
* [Troubleshooting](#troubleshooting)

## Introduction

Expand Down Expand Up @@ -485,3 +486,63 @@ After an upgrade, you may have missing indices. To fix this, you can run:
# where NEXTCLOUD_POD is *your* nextcloud pod
kubectl exec -it $NEXTCLOUD_POD -- su -s /bin/sh www-data -c "php occ db:add-missing-indices"
```
# Troubleshooting
## Logging
The nextcloud instance deployed by this chart doesn't currently create a log file locally inside the container.
Examples scenarios to change this behavior include:
- Triaging mailserver issues
- Any time you're confused by server behavior and need more context
- Before submitting a GitHub Issue (you can include relevant log messages that way)
### Changing the logging behavior
To change the logging behavior, modify your `logging.config.php` in your `values.yaml` under the `nextcloud.configs` section like so:
```yaml
nextcloud:
configs:
logging.config.php: |-
<?php
$CONFIG = array (
'log_type' => 'file',
'logfile' => 'nextcloud.log',
'loglevel' => 0,
'logdateformat' => 'F d, Y H:i:s'
);
```
`loglevel` corresponds to the detail of the logs. Valid values are:
```
0: DEBUG: All activity; the most detailed logging.
1: INFO: Activity such as user logins and file activities, plus warnings, errors, and fatal errors.
2: WARN: Operations succeed, but with warnings of potential problems, plus errors and fatal errors.
3: ERROR: An operation fails, but other services and operations continue, plus fatal errors.
4: FATAL: The server stops.
```
[More information about Nextcloud logging](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html)
### Viewing the logs
To view logs after changing the logging behavior, you can exec into the Kubernetes pod, or copy them to your local machine.
#### Exec into the kubernetes pod:
```bash
kubectl exec --stdin --tty nextcloud-pod-name-random-chars -- /bin/sh
```
#### Then look for the `nextcloud.log` file with tail or cat:
```bash
cat nextcloud.log
tail -f nextcloud.log
```
#### Copy the log file to your local machine:
```bash
kubectl cp default/nextcloud-pod-name-random-chars:nextcloud.log ./my-local-machine-nextcloud.log
```
### Sharing the logs
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 comments on commit 2ee0dd9

Please sign in to comment.