Notes
This release of the Python agent adds context data attributes to logs, support for dictionary type log messages, adds attribute support to record_log_event
API, and obfuscation of logged license keys and user API keys.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
- Add context data attributes to logs
Context data available from logging frameworks can now be recorded as attributes on logs. These attributes are prefixed withcontext.
, which is not considered when filtering attributes from logs.
Context data may include extras, dictionary message attributes, and attributes provided by logging frameworks.
To report these attributes, enable context data forwarding and optionally configure include and exclude rules to filter the allowed attributes.
-
Add support for dictionary type log messages
Dictionary type log messages are now supported for logging frameworks which support dictionary type log messages (including the builtinlogging
module andstructlog
). The keymessage
will be extracted if available and treated as the log message, and any other items will be considered context data attributes and prefixed withmessage.
. These attributes are subject to the same filtering rules as other context data. -
Add attribute support to
record_log_event
API
Therecord_log_event
API now allows passing context data in using the optionalattributes
keyword argument, and allows the message argument to be a dictionary as described above. -
Obfuscate license keys and user API keys in logs
The agent now obfuscates all instances of license keys or user API keys in agent logs and audit logs.