Skip to content

Allow structured logging for xcube server #1060

@forman

Description

@forman

Is your feature request related to a problem? Please describe.

We need more detailed information of how xcube server deployments perform.

Describe the solution you'd like

xcube server therefore shall have a new option to output well-structured logs that include key fields such as timestamps, log levels, and unique identifiers. This makes it easier to query and analyze the data.

We'll replace the standard "tornado.access" logs by structured JSON logging that also includes details of the current request.

Example log entry:

{
  "timestamp": "2024-08-15T08:59:23Z",
  "level": "INFO",
  "message": "User login successful",
  "user": {
    "id": "12345",
    "username": "johndoe"
  },
  "request": {
    "method": "POST",
    "url": "/api/login",
    "status": 200,
    "response_time_ms": 123
  },
  "application": {
    "name": "MyApp",
    "version": "1.0.0"
  },
  "environment": "production"
}

Implementing structured logging:

For implementation in Tornado:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions