Skip to content

Improve schema validation log output #144

Open
@marcvdijk

Description

@marcvdijk

Currently the output of a JSON schema validation failure is difficult to read for the user because of:

  1. Error always starts with a another error thrown by the logging service that has nothing to do with
    the schema validation error itself and should not even occur adding to the confusion.
    Error starts with:

    Unable to format event {'log_namespace': 'lie_workflow.workflow_runner', 'log_level':
    <LogLevel=error>, 'log_logger': <Logger 'lie_workflow.workflow_runner'>, ....

  2. The error stack trace contains the full Exception output of the schema validation error thrown by
    the "jsonschema" package. That one contains the full input/output of the service and that can
    become quite big resulting in lots of log output making it difficult to pinpoint the problem.

  3. Schema validation exceptions are JSON constructs that are printed "inline" but for human
    readability it is better to "pretty print" them.

I think it would be a good idea to only log the core reason for the validation to fail such as "wrong type" or required parameter X missing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions