Closed GitRon closed 4 years ago
There's nothing magical about the logging. Since we're inside a django management command, we're subject to django's logging settings. Please check that your settings are not too strict and allow logging from django_scrubber.*
at the level you wish.
Hm, I tried to set up the logger like I would do normally, but nothing happened.
LOGGING['loggers']['scrub_data'] = {
'handlers': ['console'],
'propagate': True,
'level': 'DEBUG',
}
I guess I need to use scrub_data
as key because it says in the MC: logger = logging.getLogger(__name__)
The key is the module path, so it should start with django_scrubber.
(wildcards work, so django_scrubber.*
should be all you need)
Like this?
LOGGING['loggers']['django_scrubber.*'] = {
'handlers': ['console'],
'propagate': True,
'level': 'DEBUG',
}
Yes, assuming you have LOGGING['handlers']['console']
set to something reasonable, like here.
Hm, maybe some weird setup in my project. Everything looks fine but nothing is showing up in the console...
I'll close this for now, but let us know if there more reason to think the problem might be on our side.
Ok, it works like this:
LOGGING['loggers']['django_scrubber.scrubbers'] = {
'handlers': ['console'],
'propagate': True,
'level': 'DEBUG',
}
Maybe add this to the docs? Not seeing ANYTHING for a process that can take a long time is not very satisfying.
Secondly, it would be awesome if the logger would log which model is currently being scrubbed and maybe how many records have been processed (I still don't get the magic how you make a query 😅 )
@costela Maybe we can create a separate issue for this one?
Create a PR for post #1 and an issue for post #2: https://github.com/RegioHelden/django-scrubber/issues/18
So we can let this issue here rest in peace ;)
Hi @costela
I saw that there are some logs within the
scrub_data
command but I didn't mange to let it log somewhere.Could you provide an example? I'd be willing to update the docs then 😃
Best Ronny