ging / fiware-pep-proxy

Support for proxy functions within OAuth2-based authentication schemas. Also implements PEP functions within an XACML-based access control schema.
https://fiware-pep-proxy.rtfd.io/
MIT License
27 stars 46 forks source link

Replace npm log4js library with npm debug library #120

Closed jason-fox closed 3 years ago

jason-fox commented 3 years ago

Proposed changes

The PEP-Proxy currently uses log4js for its debug logging, this is problematic because it is the only common FIWARE component to do so and the configuration file lies within the Dockerized source code container making it difficult to change the settings when diagnosing issues.

This PR replaces log4js with debug and morgan which is a much more widely used combination within Express Apps and aligns with the current logging combination within Keyrock.

Debug is controlled by two ENV parameters

set DEBUG=*,-not_this npm start

Uses standard debug filtering using wild-cards - all PEP-Proxy messages use the prefix pep-proxy

set PEP_PROXY_DEBUG=true

decides whether to log incoming requests (in the same fashion as IDM_DEBUG on Keyrock.

Types of changes

What types of changes does your code introduce to the project: Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

github-actions[bot] commented 3 years ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️

apozohue10 commented 3 years ago

Thank you for your contribution

apozohue10 commented 3 years ago

I have read the CLA Document and I hereby sign the CLA