-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added script for log viewer #1042
Added script for log viewer #1042
Conversation
PR Summary
|
Good idea, @bbakalov! Hold my beer, buddy) The problem you describe is related to the fact that macOS uses a different color scheme for managing text color than Ubuntu or other Linux systems. I tried to fix it, can you check now? |
ef69e7c
to
3b1d482
Compare
Adding
|
I don't have a Mac to check this, I added it to the prior commit. Hopefully, this will be helpful.
Perhaps I described the functionality incorrectly, and you are confused. I added the ability to tail all error logs in real-time in the selected file. Run bin/log, then choose option 4, then option 2 (View only error logs in real-time), where you can select the name of the log file you wish to examine.
Yes, I know, I pointed it out here:
This is not "interesting behavior", this was done on purpose to avoid mixing logs from different files. BTW, feel free to contribute :) |
Thank you, I appreciate this PR and the updates made. However, the first run-through of this script didn't go well for me. Here is the output:
The Y/n prompt is very confusing, because I was expecting to enter a 1, 2, or 3 to designate the type of file that I'd like tailed.
I was presented with yet another permutation. I wasn't asked 1, 2, or 3, or for a Y/n, but rather the name of the log file. I think if you are running with the numbered list, the prompts should ALWAYS be 1, 2, 3, etc., never a Y/n, and never the name of a file. It's extremely confusing otherwise. I was also randomly presented with:
I don't know what I'm supposed to do. Type enter? Then the Continue Y/n prompt... what am I continuing to? What happens when I type Y? What happens when I type N? I'm very confused. The script has potential but the UX needs a lot of work. |
Closing in favor of #1060 |
Pull Request Description
Summary
This pull request adds a script designed for managing and analyzing Magento 2 logs. The script provides functionality to view existing log files, display the content of specific log files, and search for errors in log files.
bin/log
) to the project for Magento 2 log management.Usage Instructions
Screenshots
Updated 09.02.2024
Add the possibility to tail logs in real-time
Video how the script works:
script.log.video.mp4
Updated 10.02.2024
Changes made
Delete duplicate code
Add the possibility to tail all error logs in real time
Add the possibility to execute
bin/log
with argumentsFor example
bin/log --tail cron.log system.log
ORbin/log -t system.log cron.log
to shortenTo avoid mixing, I did it as follows:
First, the logs from the first file are displayed, then after
Ctrl + C
you can see the real-time logs from the second fileHow works added features:
script.log.video.webm
Updated 15.02.2024
Add the possibility to configure options (log path and container name)
Hello friends, this functionality will be useful for those with log files stored in a folder other than the default, so you can change it to suit your needs. Also, for your convenience, if you don't want to change the path or container name, press
Enter
to keep the current valueHow works added feature:
script.log.options.webm
P.S. I'm also going to develop the ability to view logs in a certain date range, would this be useful to you?
Feel free to provide feedback or suggestions for improvement.