mirror of
https://github.com/caronc/apprise-api.git
synced 2024-11-07 16:54:10 +01:00
Added console logging with optional LOG_LEVEL env override (#33)
This commit is contained in:
parent
54e8e06fcf
commit
3208e5e27c
@ -164,6 +164,7 @@ The use of environment variables allow you to provide over-rides to default sett
|
||||
| `SECRET_KEY` | A Django variable acting as a *salt* for most things that require security. This API uses it for the hash sequences when writing the configuration files to disk (`hash` mode only).
|
||||
| `ALLOWED_HOSTS` | A list of strings representing the host/domain names that this API can serve. This is a security measure to prevent HTTP Host header attacks, which are possible even under many seemingly-safe web server configurations. By default this is set to `*` allowing any host. Use space to delimit more than one host.
|
||||
| `BASE_URL` | Those who are hosting the API behind a proxy that requires a subpath to gain access to this API should specify this path here as well. By default this is not set at all.
|
||||
| `LOG_LEVEL` | Adjust the log level to the console; the default value is `DEBUG` if the `DEBUG` is set below otherwise the default is `INFO`. Possible values are `ERROR`, `WARNING`, `INFO`, and `DEBUG`.
|
||||
| `DEBUG` | This defaults to `False` however can be set to `True` if defined with a non-zero value (such as `1`).
|
||||
|
||||
|
||||
|
@ -77,6 +77,29 @@ TEMPLATES = [
|
||||
},
|
||||
]
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': True,
|
||||
'formatters': {
|
||||
'standard': {
|
||||
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
|
||||
},
|
||||
},
|
||||
'handlers': {
|
||||
'console': {
|
||||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'standard'
|
||||
},
|
||||
},
|
||||
'loggers': {
|
||||
'apprise': {
|
||||
'handlers': ['console'],
|
||||
'level': os.environ.get(
|
||||
'LOG_LEVEL', 'debug' if DEBUG else 'info').upper(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
WSGI_APPLICATION = 'core.wsgi.application'
|
||||
|
||||
# Define our base URL
|
||||
|
Loading…
Reference in New Issue
Block a user