coolify icon indicating copy to clipboard operation
coolify copied to clipboard

[WIP]: Improve logs

Open yohannlog opened this issue 1 year ago • 10 comments

[ 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:

  • [ ] Create a service dedicated to logging. (https://github.com/yohannlog/coolify-logs)
  • [ ] Add API support
  • [ ] Send logs to this service

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
  • [x] 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 ?
  • [x] 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 avatar Jun 19 '24 11:06 yohannlog

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

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

peaklabs-dev avatar Jun 19 '24 15:06 peaklabs-dev

For the moment, I did that: image

yohannlog avatar Jun 19 '24 17:06 yohannlog

@yohannlog Looks amazing. Thank you so much.

peaklabs-dev avatar Jun 19 '24 18:06 peaklabs-dev

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.

peaklabs-dev avatar Jun 19 '24 18:06 peaklabs-dev

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.

yohannlog avatar Jun 20 '24 10:06 yohannlog

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.

iamEvanYT avatar Jun 20 '24 15:06 iamEvanYT

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

yohannlog avatar Jun 21 '24 07:06 yohannlog

[ PR TEXT UPDATED ]

yohannlog avatar Jun 24 '24 20:06 yohannlog

⚠️ GitGuardian has uncovered 2 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
- - GitHub App Keys ccbbfd89087d948f83d99d8006aada81dcf906fc database/seeders/GithubAppSeeder.php View secret
- - Generic Password e1bcae7aafb83563e1b34aceef5d15d079c2211d templates/compose/resend.yaml 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.

gitguardian[bot] avatar Jul 04 '24 17:07 gitguardian[bot]

This pull request is currently in draft status. We would like to merge the current changes, so please finish the current changes and take the PR out of draft status. If no action is taken, this PR will be closed for inactivity. I moved all you other change ideas to your discussion here https://github.com/coollabsio/coolify/discussions/2618#discussioncomment-10802524

peaklabs-dev avatar Sep 30 '24 20:09 peaklabs-dev

If you decide to work on this again, feel free to open a new PR that is also up to date with the latest available version.

peaklabs-dev avatar Oct 08 '24 09:10 peaklabs-dev