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
Add Logging View #1080
Add Logging View #1080
Conversation
@BradleySappington or @bhilbert4 this is ready for a review when ready! |
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.
Do you think we should be able to see logs from all servers regardless of what server the user is on?
|
||
full_log_paths = sorted(glob.glob(os.path.join(log_path, server, '*', '*')), reverse=True) | ||
full_log_paths = [log for log in full_log_paths if not os.path.basename(log).startswith('.')] | ||
log_dictionary = {os.path.basename(path): path for path in full_log_paths} |
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.
Dictionary comprehension! I had forgotten that was a thing. :)
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.
This was super useful here.
jwql/website/apps/jwql/views.py
Outdated
|
||
full_uri = request.build_absolute_uri() | ||
|
||
if 'dljwql' in full_uri: |
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.
Do you think this is something that would be useful to have as its own general function somewhere, or is there not enough use for it to warrant a separate function?
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.
So this was causing the issue with the production logs being show on the test server. I went ahead and changed it to use the socket
library to get the hostname of the machine rather than the URL.
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.
May be cleaner to keep javascript code in the javascript module when appropriate.
else: | ||
server = 'ops' | ||
|
||
full_log_paths = sorted(glob.glob(os.path.join(log_path, server, '*', '*')), reverse=True) |
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.
you may need more tests to verify you are on the correct server. "pljwql" is showing up on the test server.
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.
I went ahead and used a different library for this portion of the app. I have it working successfully now!
Adding page that will allow users to view logs interactively in the application.