|
1 | 1 | # DRF API Logger |
2 | | - |
| 2 | + |
3 | 3 | [](http://pepy.tech/project/drf-api-logger) |
4 | 4 | [](https://pepy.tech/project/drf-api-logger) |
5 | 5 | [](https://pepy.tech/project/drf-api-logger) |
6 | 6 | [](https://opensource.org/) |
7 | 7 | [](https://paypal.me/chynybekov) |
8 | 8 |
|
9 | | -<a href="https://discord.gg/Kr8SbgPe"><img src="https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white" alt="Join Community Badge"/></a> |
| 9 | +<a href="https://discord.gg/eeYansFDCT"><img src="https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white" alt="Join Community Badge"/></a> |
10 | 10 | <a href="https://www.instagram.com/coderssecret/"><img src="https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white" alt="Join Instagram"/></a> |
11 | 11 | <a href="https://github.com/vishalanandl177"><img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white" alt="GitHub"/></a> |
12 | 12 |
|
@@ -184,6 +184,12 @@ DRF_API_LOGGER_SLOW_API_ABOVE = 200 # Default to None |
184 | 184 | # Specify in milli-seconds. |
185 | 185 | ``` |
186 | 186 |
|
| 187 | +### Want to log only selected request methods? (Optional) |
| 188 | +You can log only selected methods by specifying `DRF_API_LOGGER_METHODS` in settings.py. |
| 189 | +```python |
| 190 | +DRF_API_LOGGER_METHODS = ['GET', 'POST', 'DELETE', 'PUT'] # Default to empty list (Log all the requests). |
| 191 | +``` |
| 192 | + |
187 | 193 | ### Want to see the API information in local timezone? (Optional) |
188 | 194 | You can also identify slow APIs by specifying `DRF_API_LOGGER_TIMEDELTA` in settings.py. |
189 | 195 | It is going to display the API request time after adding the timedelta specified in the settings.py file. |
|
0 commit comments