Skip to content

Commit d352db3

Browse files
authored
Merge pull request #10604 from joshtrichards/jr-admin-audit-logging
(logging configuration) Expand the admin_audit section
2 parents 49c5785 + 9017eb1 commit d352db3

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
---------
@@ -131,34 +135,55 @@ Log field breakdown
131135

132136
Empty value are written as two dashes: ``--``.
133137

134-
Admin audit log
135-
---------------
138+
Admin audit log (Optional)
139+
--------------------------
140+
141+
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``.
136142

137-
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``:
143+
If you wish to override this and log to syslog instead the following would be one approach:
138144

139145
::
140146

141-
'log.condition' => [
142-
'apps' => ['admin_audit'],
147+
"log_type_audit" => "syslog",
148+
"syslog_tag_audit" => "Nextcloud",
149+
"logfile_audit" => "",
150+
151+
Log level interaction
152+
~~~~~~~~~~~~~~~~~~~~~
153+
154+
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``:
155+
156+
::
157+
158+
"log.condition" => [
159+
"apps" => ["admin_audit"],
143160
],
144161

162+
Find detailed documentation on auditable events for enterprises in our `customer portal <https://portal.nextcloud.com/article/using-the-audit-log-44.html>`_.
163+
164+
Integrating into the Web Interface
165+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166+
167+
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``.
145168

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

148171
::
149172

150-
"log_type_audit" => "syslog",
151-
"syslog_tag_audit" => "Nextcloud",
152-
"logfile_audit" => "",
173+
'log.condition' => [
174+
'apps' => [ 'admin_audit'],
175+
],
176+
'logfile_audit' => '/var/www/html/data/nextcloud.log',
177+
178+
Configuring through admin_audit app settings
179+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153180

154-
Previously the logfile could be defined in the app config. This config is still used when the system config is not provided:
181+
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.
155182

156183
::
157184

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

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-
162187
.. _PHP date function: http://www.php.net/manual/en/function.date.php
163188

164189
Workflow log

0 commit comments

Comments
 (0)