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

[WIP]: Improve logs #2598

Draft
wants to merge 7 commits into
base: next
Choose a base branch
from
Draft

[WIP]: Improve logs #2598

wants to merge 7 commits into from

Conversation

yohannlog
Copy link

@yohannlog yohannlog commented Jun 19, 2024

[ UPDATED 24/06/2024 ]

I've decided to completely overhaul the way logs are managed. The current system doesn't save logs, and this is a major problem. What's more, adding a backup system on top of the old one is quite restrictive. That's why I decided to implement several things:

Major change:

Features:

  • Save logs in files ( {container_id}/{dd_mm_yy.csv} ) with rotation and file size limits
  • Save logs in database
  • Send logs to custom service ?
  • Add a page dedicated to logs with history (New button to left menu)
  • Add "Show more" buttons on large logs
  • Supports ANSI color format
  • Add tabs when multiple servers in one page
  • Add a "Download button"
  • Add a checkbox to download using max lines
  • Add type="number" to max lines input
  • Add search filter
  • Add option to download logs on only filtered logs
  • Add styles to logs ?
  • Add a wrap lines checkbox so that log lines are automatically wrapped (to viewport size).
  • Save wrap lines option
  • Add style for + and - button (For wrapping lines)
  • Make time clickable to filter logs
  • Review the code in GetLogs.php to simplify it (duplicate code, etc.).

This PR or later

  • Manage json logs format

If I need to, I'll make a design modification to keep it readable and understandable.

@yohannlog yohannlog changed the title feat: add logs download button [WIP]: Improve logs Jun 19, 2024
@yohannlog yohannlog marked this pull request as draft June 19, 2024 12:51
@ayntk-ai
Copy link

ayntk-ai commented Jun 19, 2024

No idea if this can work but for logs that are very long a wrap lines feature would be handy:

  • Add a wrap lines checkbox so that log lines are automatically wrapped (to viewport size).

@yohannlog
Copy link
Author

For the moment, I did that:
image

@ayntk-ai
Copy link

@yohannlog Looks amazing. Thank you so much.

@ayntk-ai
Copy link

ayntk-ai commented Jun 19, 2024

Add styles to logs ?

@yohannlog I think this would be possible, for example, errors could be highlighted in red, success in green, warning in orange/yellow and the rest in white.

@yohannlog
Copy link
Author

Add styles to logs ?

@yohannlog I think this would be possible, for example, errors could be highlighted in red, success in green, warning in orange/yellow and the rest in white.

The only thing I can test is show colors from logs generated by an application. It is complicated to determine what log type it is.

@iamEvanYT
Copy link
Contributor

The only thing I can test is show colors from logs generated by an application. It is complicated to determine what log type it is.

Showing colors generated by an application sounds cool.

@yohannlog
Copy link
Author

I've added a discussion about this PR: #2618

@yohannlog
Copy link
Author

[ PR TEXT UPDATED ]

Copy link

gitguardian bot commented Jul 4, 2024

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
12428579 Triggered Generic Password 1253427 app/Http/Controllers/Api/DatabasesController.php View secret
12428579 Triggered Generic Password 1253427 app/Http/Controllers/Api/DatabasesController.php View secret
12661388 Triggered Generic Password 1253427 app/Http/Controllers/Api/DatabasesController.php View secret
12661388 Triggered Generic Password 1253427 app/Http/Controllers/Api/DatabasesController.php View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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.

None yet

3 participants