All the requests and responses are logged in a web framework, but it is logging(using the logging module) in passwords also (because passwords are in login requests).
Can i selectively print 'XXXXXXX' for password or any other fields i dont wish to print?
in authentication.py
import logging
from logging import config
logging.config.dictConfig({'version': 1, 'delete_existing_loggers': False, 'handlers': '.....'})
LOGGER = logging.getLogger(__name__)
##code to get variables from http request packet (like method, parameters)(for example, methods, params can be: [authentication.login, username, password], [authentication.change_password, username, old_password, new_password], [authentication.generate_validation_code, username]),
LOGGER.info('method %s with %s parameters called', method, params)
so here i want, for specific methods, some variables should be 'xxxxx' instead of original value, specifically if the method is 'authentication.login' I want to print 'xxxx' for second parameter in the params.
Thanks.