Skip to content

Commit 396fb45

Browse files
authored
Merge pull request #10615 from nextcloud/backport/10604/stable25
[stable25] (logging configuration) Expand the admin_audit section
2 parents 9b7b791 + ee1d567 commit 396fb45

File tree

1 file changed

+38
-13
lines changed

1 file changed

+38
-13
lines changed

admin_manual/configuration_server/logging_configuration.rst

+38-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
Logging
33
=======
44

5-
Use your Nextcloud log to review system status, or to help debug problems. You may adjust logging levels, and choose between using the Nextcloud log or your syslog. If additional audit information is required, you can optionally activate the **admin_audit** app, which by default generates a separate audit.log file in the data directory.
5+
Use your Nextcloud log to review system status, or to help debug problems. You may adjust logging levels, and choose how and where log data is stored. If additional event logging is required, you can optionally activate the **admin_audit** app.
6+
7+
When ``file`` based logging is utilized, both the Nextcloud log and, optionally, the **admit_audit** app log can be viewed within the Nextcloud interface under *Administration settings -> Logging* (this functionality is provided by the **logreader** app).
8+
9+
Further configuration and usage details for both the standard Nextcloud log and the optional **admin_audit** app log can be found below.
610

711
Log level
812
---------
@@ -129,34 +133,55 @@ Log field breakdown
129133

130134
Empty value are written as two dashes: ``--``.
131135

132-
Admin audit log
133-
---------------
136+
Admin audit log (Optional)
137+
--------------------------
138+
139+
By enabling the **admin_audit** app, additional information about various events can be logged. Similar to the normal logging, the audit log can be provided to any of the existing logging mechanisms in :file:`config/config.php`. The default behavior, if no parameters are specified after the app is enabled, is ``file`` based logging to a file called ``audit.log`` stored in the ``datadirectory``.
134140

135-
If ``loglevel`` in ``config.php`` is set to ``2`` or higher, audit logging needs to be triggered explicitly by adding the following setting to to ``config.php``:
141+
If you wish to override this and log to syslog instead the following would be one approach:
136142

137143
::
138144

139-
'log.condition' => [
140-
'apps' => ['admin_audit'],
145+
"log_type_audit" => "syslog",
146+
"syslog_tag_audit" => "Nextcloud",
147+
"logfile_audit" => "",
148+
149+
Log level interaction
150+
~~~~~~~~~~~~~~~~~~~~~
151+
152+
If system ``loglevel`` in ``config.php`` is set to ``2`` or higher, audit logging needs to be triggered explicitly by adding the following setting to to ``config.php``:
153+
154+
::
155+
156+
"log.condition" => [
157+
"apps" => ["admin_audit"],
141158
],
142159

160+
Find detailed documentation on auditable events for enterprises in our `customer portal <https://portal.nextcloud.com/article/using-the-audit-log-44.html>`_.
161+
162+
Integrating into the Web Interface
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
165+
The built-in NC ``logreader`` app (which is what provides the *Administration settings->Logging* interface) only accesses the file-based ``nextcloud.log``. The **admin_audit** app log output, however, can be integrated into the web interface by configuring it to *also* log to the ``nextcloud.log``.
143166

144-
Similar to the normal logging, the audit log can be written to any of the existing logging mechanism in :file:`config/config.php`:
167+
Add the following to your ``config.php`` (adjusting the path to your own ``nextcloud.log`` path):
145168

146169
::
147170

148-
"log_type_audit" => "syslog",
149-
"syslog_tag_audit" => "Nextcloud",
150-
"logfile_audit" => "",
171+
'log.condition' => [
172+
'apps' => [ 'admin_audit'],
173+
],
174+
'logfile_audit' => '/var/www/html/data/nextcloud.log',
175+
176+
Configuring through admin_audit app settings
177+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151178

152-
Previously the logfile could be defined in the app config. This config is still used when the system config is not provided:
179+
Previously the audit logfile was defined in the app config. This config is still used when the system config is not provided, but is considered a legacy parameter.
153180

154181
::
155182

156183
occ config:app:set admin_audit logfile --value=/var/log/nextcloud/audit.log
157184

158-
Find detailed documentation on auditable events for enterprises in our `customer portal <https://portal.nextcloud.com/article/using-the-audit-log-44.html>`_.
159-
160185
.. _PHP date function: http://www.php.net/manual/en/function.date.php
161186

162187
Workflow log

0 commit comments

Comments
 (0)