Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

(Dodal #487) Improve logging formatting for documents #1373

Merged
merged 9 commits into from
May 16, 2024

Conversation

d-perl
Copy link
Contributor

@d-perl d-perl commented May 10, 2024

Fixes DiamondLightSource/dodal#487 Fixes #634
Formats the documents in messages emitted by the event logging callback to indented JSON, generating messages like: https://graylog.diamond.ac.uk/messages/graylog-daq-mx-hyperion_17/741f64c5-0ea2-11ef-a69c-fae0dce5bd43

To test:

  1. Run tests

@d-perl d-perl marked this pull request as draft May 10, 2024 07:57
@d-perl d-perl changed the title (#487) Improve logging formatting for documents (Dodal #487) Improve logging formatting for documents May 10, 2024
@d-perl d-perl force-pushed the 487_improve_logging_formatting branch from a81fce8 to 05d2dc1 Compare May 10, 2024 08:00
@d-perl d-perl force-pushed the 487_improve_logging_formatting branch from 05d2dc1 to 611a7b1 Compare May 10, 2024 08:01
@d-perl d-perl marked this pull request as ready for review May 10, 2024 10:23
Copy link
Collaborator

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you! I think you may have missed:

  • create_parameters_for_grid_detection
  •  ISPYB_LOGGER.warning(
        f"Ispyb handler {self} recieved event doc {doc} and "
          "has no corresponding descriptor record"
      )
  •   ISPYB_LOGGER.warning(
          f"Failed to finalise ISPyB deposition on stop document: {doc} with exception: {e}"
      )

Copy link
Collaborator

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I added one more that you missed. Otherwise all good!

@d-perl d-perl merged commit 9fa6d7b into main May 16, 2024
4 checks passed
@d-perl d-perl deleted the 487_improve_logging_formatting branch May 16, 2024 13:14
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
…Source/487_improve_logging_formatting

(Dodal DiamondLightSource/hyperion#487) Improve logging formatting for documents
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graylog: Improve message formatting logs get \n instead of newlines
2 participants