dean_morin
06/01/2021, 10:59 PMRECORD type messages when the log level is DEBUG. I have an issue that’s only happening in prod, and I’m trying to avoid leaking sensitive data into the logs while investigating.
I was thinking the easiest thing to do would be to add a new --log-config option that would let you point to a yaml file, where you could configure logging however you like (e.g. https://docs.python.org/3/howto/logging.html#configuring-logging). What do you think?edgar_ramirez_mondragon
06/01/2021, 11:17 PMaaronsteers
06/01/2021, 11:22 PMdean_morin
06/01/2021, 11:30 PMRECORD messages, they normally don’t appear in the logs (when the default INFO level is being used). If I switch the log level to DEBUG, I get a lot of useful extra info in the logs (which is helpful), but also those RECORD messages (which isn’t desirable given their sensitive contents).
The method of filtering them out doesn’t really matter to me, but I was looking at the filtering options in python logging as a possible way to do so 🤷. I’m not sure if that answers your question.dean_morin
06/01/2021, 11:31 PMIn Python 3.2, a new means of configuring logging has been introduced, using dictionaries to hold configuration information. This provides a superset of the functionality of the config-file-based approach outlined above, and is the recommended configuration method for new applications and deployments. Because a Python dictionary is used to hold configuration information, and since you can populate that dictionary using different means, you have more options for configuration. For example, you can use a configuration file in JSON format, or, if you have access to YAML processing functionality, a file in YAML format, to populate the configuration dictionary. Or, of course, you can construct the dictionary in Python code, receive it in pickled form over a socket, or use whatever approach makes sense for your application.
dean_morin
06/01/2021, 11:32 PMlogging.config.dictConfig() . You can use json as well, but some (very brief) googling makes it seem like yaml is the more common formatedgar_ramirez_mondragon
06/02/2021, 12:05 AMaaronsteers
06/02/2021, 12:15 AMaaronsteers
06/02/2021, 12:21 AMdean_morin
06/02/2021, 12:24 AMsteve_clarke
11/02/2021, 11:57 PMRECORD messages?aaronsteers
11/03/2021, 12:40 AMsteve_clarke
11/03/2021, 2:24 AMaaronsteers
11/03/2021, 2:52 PMdean_morin
11/03/2021, 8:00 PMkamal_singh_naruka
01/13/2023, 10:26 AM