HXLStandard / libhxl-python

Python support library for the Humanitarian Exchange Language (HXL) data standard.
The Unlicense
41 stars 11 forks source link

Improve logging for external resources #308

Closed davidmegginson closed 2 years ago

davidmegginson commented 2 years ago

Improve the logging for the external resources processed in the hxl.input module:

The goal is for the HXL Proxy to be able to capture this information and log it more granularly. Information to capture includes the following:

The HXL Proxy application layer can add the IP address making the request and other server-layer information.

davidmegginson commented 2 years ago

Info on how to do this: https://stackoverflow.com/questions/11232230/logging-to-two-files-with-different-settings

davidmegginson commented 2 years ago

Added second logger "hxl.REMOTE_ACCESS" with basic messages about remote URL access. Will add the Javascript stuff in a future release if needed, but this provides the basics of what the HXL Proxy is trying to open and what responses it gets.

emmajane commented 2 years ago

@davidmegginson Is there a PR that the ops team can review to make sure it will be sufficient? I'm not sure what the "javascript stuff" is that you're referring to so I'm not sure how to provide feedback on this...

davidmegginson commented 2 years ago

Apologies, I meant JSON. Collecting multiple points of information into a json structure is a big piece of work, that @danmihaila will have to triage; I put this small fix in place so that we will at least have the ability to see in the logs what external URLs are being accessed and what status codes are being returned.