Skip to content

Implemented simple, structured data logging#1061

Draft
forman wants to merge 1 commit intomainfrom
forman-1060-structured_logging
Draft

Implemented simple, structured data logging#1061
forman wants to merge 1 commit intomainfrom
forman-1060-structured_logging

Conversation

@forman
Copy link
Member

@forman forman commented Aug 16, 2024

xcube server can now be configured to produce structured data logs. If data_logging is true server requests are logged in form of JSON data records, that can be machine-detected and -parsed by lines starting with a { character.

Currently only applies to logging of HTTP requests.

Closes #1060.

Sample log entry:

{"timestamp": "2024-08-16 07:50:58.028860", "level": "INFO", "status": 200, "user_id": null, "duration": 102, "request": {"method": "GET", "uri": "/tiles/local/conc_tsm/8/83/128?crs=EPSG%3A3857&vmin=0.0672554675129238&vmax=30&cmap=cc_tsm&time=2017-01-16T10%3A09%3A21Z", "host": "localhost:8080", "protocol": "http", "remote_ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0"}}

Checklist:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/source/*
  • Changes documented in CHANGES.md
  • GitHub CI passes
  • AppVeyor CI passes
  • Test coverage remains or increases (target 100%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow structured logging for xcube server

1 participant