mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-03-21 23:00:55 +00:00
Page:
Database Troubleshooting
Pages
Affiliated Projects
Backend Snippets
Database Troubleshooting
Email OAuth App Setup
Home
Platform‐Specific Troubleshooting
Post Consume Script Examples
Pre Consume Script Examples
Related Projects
Scanner & Software Recommendations
Using Security Tools with Paperless ngx
Using a Reverse Proxy with Paperless ngx
Using and Generating ASN Barcodes
v3 Ideas List
No results
1
Database Troubleshooting
HiranChaudhuri edited this page 2026-03-13 08:26:54 +01:00
Table of Contents
Database Troubleshooting
SQL Logging
If you try to understand what paperless-ngx is doing to your database, one good shot is to turn on SQL logging. With that you will see all the SQL commands paperless sends to the database.
In settings.py find the location where logging is configured. It will look similar to this:
"loggers": {
"paperless": {"handlers": ["file_paperless"], "level": "DEBUG"},
"paperless_mail": {"handlers": ["file_mail"], "level": "DEBUG"},
"ocrmypdf": {"handlers": ["file_paperless"], "level": "INFO"},
"celery": {"handlers": ["file_celery"], "level": "DEBUG"},
"kombu": {"handlers": ["file_celery"], "level": "DEBUG"},
"_granian": {"handlers": ["file_paperless"], "level": "DEBUG"},
"granian.access": {"handlers": ["file_paperless"], "level": "DEBUG"},
},
Add a line like
"django.db.backends": {"handlers": ["console"], "level": "DEBUG"},
So the whole section would look like this:
"loggers": {
"paperless": {"handlers": ["file_paperless"], "level": "DEBUG"},
"paperless_mail": {"handlers": ["file_mail"], "level": "DEBUG"},
"ocrmypdf": {"handlers": ["file_paperless"], "level": "INFO"},
"celery": {"handlers": ["file_celery"], "level": "DEBUG"},
"kombu": {"handlers": ["file_celery"], "level": "DEBUG"},
"_granian": {"handlers": ["file_paperless"], "level": "DEBUG"},
"granian.access": {"handlers": ["file_paperless"], "level": "DEBUG"},
"django.db.backends": {"handlers": ["console"], "level": "DEBUG"},
},
Restart paperless-ngx and watch it's console output.
- Home
- Lists
- Setup Help
- Examples
- Troubleshooting
Feel free to contribute to the wiki pages - enhance and extend the content!
Also browse Discussions & connect in Matrix chat.