Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graylog: Improve message formatting #487

Closed
DominicOram opened this issue Apr 30, 2024 · 7 comments · Fixed by DiamondLightSource/hyperion#1373
Closed

Graylog: Improve message formatting #487

DominicOram opened this issue Apr 30, 2024 · 7 comments · Fixed by DiamondLightSource/hyperion#1373
Assignees

Comments

@DominicOram
Copy link
Contributor

Multiline messages do not format nicely on graylog, instead showing /n chars. See https://graylog.diamond.ac.uk/messages/graylog-daq-mx-hyperion_7/5018d5d6-06ef-11ef-9f8e-223dcd8d7ad4 we should try and work out if we can format them better

Acceptance Criteria

  • Investigate better formatting in graylog
  • Fix if we can
  • If this is a limitation of graylog document it somewhere as a known issue
@DominicOram DominicOram moved this to Candidates for Next Sprint in Hyperion May 5, 2024
@DominicOram
Copy link
Contributor Author

@dperl-dls thinks this may be fixed, check

@DominicOram DominicOram moved this from Candidates for Next Sprint to Todo This Sprint in Hyperion May 7, 2024
@d-perl
Copy link
Contributor

d-perl commented May 8, 2024

Not limited to graylog, it is in all logs: DiamondLightSource/hyperion#634 - should fix this at the same time

@d-perl d-perl closed this as completed May 8, 2024
@github-project-automation github-project-automation bot moved this from Todo This Sprint to Done in Hyperion May 8, 2024
@d-perl d-perl reopened this May 8, 2024
@d-perl
Copy link
Contributor

d-perl commented May 8, 2024

oops, closed by accident sorry

@DominicOram
Copy link
Contributor Author

DominicOram commented May 8, 2024

  • We should make the log formatter take care of this and replace /n with newlines properly
  • Timebox to 1 day, if we make no progress document on here why we had to stop and stop

@d-perl d-perl moved this from Done to In Progress in Hyperion May 10, 2024
@d-perl d-perl self-assigned this May 10, 2024
@d-perl
Copy link
Contributor

d-perl commented May 10, 2024

It does look like with the most recent version (I think this is probably a python 3.11 thing) we do get e.g. tracebacks formatted correctly:

https://graylog.diamond.ac.uk/messages/graylog-daq-mx-hyperion_17/6069fe10-0ea0-11ef-a69c-fae0dce5bd43

Meanwhile the json is generally formatted compactly, this is because we insert it in strings ourselves as the repr of a dict. If we want this to be formatted the solution is to do it ourselves, with json.dumps(..., indent=n):

https://graylog.diamond.ac.uk/messages/graylog-daq-mx-hyperion_17/741f64c5-0ea2-11ef-a69c-fae0dce5bd43

@DominicOram
Copy link
Contributor Author

Ah, if it's just the json then I think we should format it ourselves nicely for the logs

@d-perl d-perl moved this from In Progress to Review in Hyperion May 10, 2024
@d-perl
Copy link
Contributor

d-perl commented May 10, 2024

Well, we should probably add some solution for tracebacks in 3.10 if we are supporting it, but I don't think it's very urgent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants