mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-19 23:35:04 +01:00
MyST conversion
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# Logging from Custom Apps
|
||||
|
||||
Alliance Auth provides a logger for use with custom apps to make everyone's life a little easier.
|
||||
|
||||
## Using the Extensions Logger
|
||||
|
||||
AllianceAuth provides a helper function to get the logger for the current module to reduce the amount of
|
||||
code you need to write.
|
||||
|
||||
@@ -15,19 +17,28 @@ This works by creating a child logger of the extension logger which propagates a
|
||||
to the parent (extensions) logger.
|
||||
|
||||
## Changing the Logging Level
|
||||
|
||||
By default, the extension logger's level is set to `DEBUG`.
|
||||
To change this, uncomment (or add) the following line in `local.py`.
|
||||
|
||||
```python
|
||||
LOGGING['handlers']['extension_file']['level'] = 'INFO'
|
||||
```
|
||||
|
||||
*(Remember to restart your supervisor workers after changes to `local.py`)*
|
||||
|
||||
This will change the logger's level to the level you define.
|
||||
|
||||
Options are: *(all options accept entries of levels listed below them)*
|
||||
|
||||
* `DEBUG`
|
||||
* `INFO`
|
||||
* `WARNING`
|
||||
* `ERROR`
|
||||
* `CRITICAL`
|
||||
|
||||
```{eval-rst}
|
||||
.. automodule:: allianceauth.services.hooks.get_extension_logger
|
||||
:members:
|
||||
:undoc-members:
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user