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

feat(settings): basic log api and ui #337

Closed
wants to merge 2 commits into from
Closed

Conversation

lochstar
Copy link

@lochstar lochstar commented Dec 16, 2020

Description

This implements a very basic log UI. The number of rows returned is set to 1000. I thought I'd get this in so others can pick up from it and we can decide what we'd like from the log ui.

I separated the winston transport configs to use a JSON format for the file log, using the current text-based log that we output to the console wasn't compatible with winston.query. We should probably set some options related to maximum files and filesize.

As the format of the log overseerr.log has changed, we may need to purge or migrate an existing log on upgrade?

Other features we could implement:

  • Filters e.g. by label/level
  • Download link/view raw
  • Nicer styling
  • Manual/auto refresh option

Screenshot (if UI related)

image

Issues Fixed or Closed by this PR

@lgtm-com
Copy link

lgtm-com bot commented Dec 16, 2020

This pull request introduces 1 alert when merging 7bc1b8a into df4ac83 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

@sct sct marked this pull request as draft December 16, 2020 05:18
@sct
Copy link
Owner

sct commented Dec 16, 2020

I converted this to a draft for now while we get it ironed out.

const messages = defineMessages({
logs: 'Logs',
logsDescription:
'You can access your logs directly in stdout (container logs) or looking in /app/config/logs/overseerr.logs',
Copy link
Owner

Choose a reason for hiding this comment

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

We will want to have the same <code> tags in here like we did in the temporary message. If you only put the tags in here by themselves though, they will be just rendered out in the string.

You can see how this is done in the RequestList component. I apply tags in there.

Comment on lines +44 to +69
<div className="mt-4 text-sm">
{data?.map((row, index) => (
<div key={`log-list-${index}`} className="space-x-2 text-gray-300">
<span className="inline">
<FormattedDate
value={row.timestamp}
year="numeric"
month="short"
day="2-digit"
/>
&nbsp;
<FormattedTime
value={row.timestamp}
hour="numeric"
minute="numeric"
second="numeric"
hour12={false}
/>
</span>
<span className="inline">
[{row.level}][{row.label}]:
</span>
<span className="inline">{row.message}</span>
</div>
))}
</div>
Copy link
Owner

Choose a reason for hiding this comment

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

We can maybe re-use the table component here to make this look nice? Check out how i use it in the RequestList component.

@sct
Copy link
Owner

sct commented Dec 21, 2020

@lochstar Are you still working on this?

@lochstar
Copy link
Author

Planning on it, yes.

@sct sct closed this Jan 25, 2021
@danshilm danshilm mentioned this pull request Feb 22, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

About and Logs pages give 404
2 participants