Open LingboTang opened 7 years ago
If I add filters through a subclass that is inherited from logging.Filter
, I should be able to log some message to graylog through manage.py shell
with self-defined filters. However, I still couldn't get any messages log to graylog when I run my django server and sending resquest to django after I defined the loggers.
I have the following settings for django in
settings.py
:But I didn't see any filters setup for graylog in GUI, so I checked it locally with
logging.getLogger('testlogger').handlers[0].filters[0].__dict__
and it returns{'name': '', 'nlen': 0}
. Then I made a little change that I throw thefilters
outhandlers
and put that inloggers
like:And it didn't work as well. The only way seems working for me is manually add a filter class just like the sample in README. So I don't know if dict config hasn't been supported by graylog or I did something in my config.