Skip to content

Commit

Permalink
doc: add troubleshooting page with logging section
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhuser authored and JonasKs committed Oct 18, 2023
1 parent f54831e commit c37c687
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/docs/usage-and-faq/troubleshooting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Troubleshooting
sidebar_position: 8
---

## Logging

If you run into any problems, set the logging level to `DEBUG` and check the logs for more information.

Below an example:

```python title="logging_config.py"
from logging.config import dictConfig

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(name)s %(message)s'
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
},
'loggers': {
'fastapi_azure_auth': {'handlers': ['console'], 'level': 'DEBUG', 'propagate': False},
},
}

dictConfig(LOGGING)
```

:::info
It is recommended to call the `dictConfig()` function before the FastAPI (and `fastapi-azure-auth`) initialization.
:::

0 comments on commit c37c687

Please sign in to comment.