@@ -106,12 +106,13 @@ Log every request into the database. Add these lines in the Django Rest Framewor
106
106
:alt: Details
107
107
108
108
109
- Note: Make sure to migrate. It will create a table for the logger if
110
- “DRF_API_LOGGER_DATABASE” is True else if already exists, it will delete
111
- the table.
109
+ .. note ::
110
+ Make sure to migrate. It will create a table for the logger if
111
+ “DRF_API_LOGGER_DATABASE” is True else if already exists, it will delete
112
+ the table.
112
113
113
- To listen for the logger signals.
114
- *********************************
114
+ To listen for the logger signals
115
+ ********************************
115
116
116
117
Listen to the signal as soon as any API is called. So you can log the
117
118
API data into a file or for different use cases.
@@ -180,7 +181,12 @@ Specify an interval (In Seconds).
180
181
.. note ::
181
182
The API call time (added_on) is a timezone-aware datetime object.
182
183
It is the actual time of the API call irrespective of interval value or
183
- queue size. ### Skip namespace You can skip the entire app to be logged
184
+ queue size.
185
+
186
+ Skip the namespace
187
+ ==================
188
+
189
+ Skip namespace You can skip the entire app to be logged
184
190
into the database by specifying the namespace of the app as a list.
185
191
186
192
.. code :: python
@@ -203,11 +209,11 @@ Hide Sensitive Data From Logs
203
209
204
210
You may wish to hide sensitive information from being exposed in the
205
211
logs. You do this by setting ``DRF_API_LOGGER_EXCLUDE_KEYS `` in
206
- settings.py to a list of your desired sensitive keys. The default is
212
+ settings.py to a list of your desired sensitive keys.
207
213
208
214
.. code :: python
209
215
210
- DRF_API_LOGGER_EXCLUDE_KEYS = [' password' , ' token' , ' access' , ' refresh' ]
216
+ DRF_API_LOGGER_EXCLUDE_KEYS = [' password' , ' token' , ' access' , ' refresh' ] # Default
211
217
# Sensitive data will be replaced with "***FILTERED***".
212
218
213
219
Change the default database to store API logs
0 commit comments