Nextcloud logging records and documents all relevant events and processes within your cloud en­vir­on­ment, helping you monitor the system’s status and detect potential errors early. The storage location of the in­form­a­tion, as well as how you access the Nextcloud logs, depends on the log variant you choose.

What is meant by Nextcloud logging?

Nextcloud logging refers to the col­lec­tion and doc­u­ment­a­tion of system-relevant in­form­a­tion within a Nextcloud instance. This feature is primarily used to monitor the system’s status and identify potential sources of errors at an early stage. Logging also helps track unusual activ­it­ies and security-related events, such as un­au­thor­ised access attempts. The collected in­form­a­tion is stored in logs that ad­min­is­trat­ors can analyse to ensure the smooth operation of the cloud or resolve any issues.

Tip

Another important tool for the long-term pro­tec­tion of your Nextcloud instance is the ver­sion­ing feature, which is enabled by default and allows you to restore older file versions. You can read more about this feature in the separate article on Nextcloud Ver­sion­ing.

What Nextcloud log levels are there?

Nextcloud dis­tin­guishes between five logging levels that indicate the extent of in­form­a­tion being logged. These Nextcloud log levels are as follows:

0 – DEBUG: At this level, all activ­it­ies are recorded, making it the most detailed logging level within a Nextcloud instance.

1 – INFO: This level logs file activ­it­ies, user logins, as well as warnings, errors and critical errors.

2 – WARN: Besides errors and critical errors, Nextcloud logging at level 2 also records suc­cess­ful op­er­a­tions that have led to warnings about potential issues.

3 – ERROR: Only critical errors and failed op­er­a­tions, which do not neg­at­ively affect other services aornd op­er­a­tions, are recorded.

4 – FATAL: Logging only occurs in this case if the server is stopped.

The para­met­ers for the logging level are defined in the config/config.php file. In the Nextcloud config.php, the default log level is set to 2 (WARN). For troubleshoot­ing, it is advisable to enable DEBUG. However, after error analysis, the log level should be reverted to a less detailed level. Since DEBUG logs a large volume of in­form­a­tion, the server’s per­form­ance may be affected.

Tip

If you use Managed Nextcloud by IONOS, you can avoid the ad­min­is­trat­ive effort of in­stalling, main­tain­ing and updating your cloud server. This allows you to fully focus on using your cloud and Nextcloud apps. Benefit from secure server in­fra­struc­ture and high data pro­tec­tion standards!

What Nextcloud logs are there and where can they be found?

Nextcloud offers users various types of logs to document activ­it­ies and processes. These include errorlog, file, syslog, and systemd - four different logging options, which we will explain in more detail below.

Note

Depending on the preferred logging method, the log_type parameter in the config/config.php file must be set to ‘errorlog’, ‘file’, ‘syslog’, or ‘systemd’.

errorlog

With this method, all log in­form­a­tion is sent to error_log(), which means it is stored in the web server’s error log file. The location of this file depends on the server’s configuration. For example, if Apache is used, you would typically find the file located at/var/log/apache2/error.log`. However, you can generally change the location manually at any time.

file

All Nextcloud logs are stored in a separate file, which is named nextcloud.log by default and located in the /var/www/nextcloud/data/ directory path. You can specify the file name using the logfile parameter, and op­tion­ally set the desired date format with the logdateformat parameter in config/config.php.

syslog

All log in­form­a­tion is sent to the central daemon programme of the cloud software. This refers to a con­tinu­ously running back­ground process that handles periodic service requests.

systemd

With this type of Nextcloud logging, the logs are stored in the systemd journal, which manages the services running on the system. The PHP extension php-systemd must be installed for this method.

How to open Nextcloud logs

If you use file-based Nextcloud logging, you can easily view all log data through the admin settings (under ‘Logging’). This feature is provided by the Log Reader app, which also allows you to download log files. For other logging options, logs can be opened with a text editor and/or via the command line.

Image: Nextcloud 'Logging' menu
Logging Menu in the Nextcloud Interface
Managed Nextcloud
Cloud storage that puts you in control
  • Keep your data safe with industry-leading security
  • Save time on updates and main­ten­ance
  • Easily add apps and online office tools
Go to Main Menu