-
Notifications
You must be signed in to change notification settings - Fork 45
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
Feature/runtime logs #735
Feature/runtime logs #735
Conversation
Thanks. Another issue that I just found is that not logs get to the hook for some reason. Apparently, new subloggers created by e.g. dmsg do not inherit hooks. @Senyoret1 log entries are inherently heterogeneous, because callers add their own data that makes sense to them to the entries. JSON representation just gets all the data that is there. |
@i-hate-nicknames this endpoint and the returned logs do not need to be colored to be honest. We will mostly use this for diagnostics so we may even just return a file to the user with plain text. Colored and nicely formatted text in the UI would be cool but not really necessary so I would keep it simple. |
@Senyoret1 ended up using json formatter, because standard text formatter only pretty-prints entries when using colors. I will update PR description with fields that are included in every entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
01476ac
to
9f569de
Compare
Did you run
make format && make check
?Fixes #725
Changes:
GET /api/visors/{pk}/runtime-logs
endpointHow to test this PR:
Run visor with hypervisor. Check output of the request.
Response is an array of json-encoded log entries. Entries are created by logger clients and can have custom fields with values, e.g. PK field that provide additional info.
Each log entry should have the following fields:
time
: formatted timestamp of the log entrymsg
: message of the entrylevel
: level of the entrylog_line
: log entry line in the global log. Since the capacity of log store is limited, some old entries could be dropped.All other keys may be absent in some entries.