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

bin/log command added #1060

Merged
merged 5 commits into from
Feb 24, 2024
Merged

bin/log command added #1060

merged 5 commits into from
Feb 24, 2024

Conversation

bbakalov
Copy link
Contributor

@bbakalov bbakalov commented Feb 9, 2024

It's the new command bin/log that tail logs from the Magento var/log folder all and specific logs.

Usage:
bin/log <specific_log_files>

Arguments:
specific_log_files If specific_log_files are NOT provided, show all logs.
Example:

bin/log system.log cache.log

Options:
-h, --help Display help message

Copy link

what-the-diff bot commented Feb 9, 2024

PR Summary

  • New "Log" File Additions
    A new file named "log" has been introduced in the "compose/bin" directory which will help in keeping a record of the program execution.

  • Improved Script Functionality
    The script has been enhanced to offer clear information about its use, arguments and options via a new function called "display_help". Now, when the script is run with "-h" or "--help", it will provide helpful usage information.

  • Enhanced Log File Path Generation & Retrieval
    Two crucial functions namely "generate_logs_file_path" and "get_all_logs_file_path" have been added. The former will help generate a path for log files based on the container path and specified log files while the latter makes it easy to accumulate all log files' path from a specific location.

  • Specific Log File Tracking
    The script has been further updated to check for specific log files that might be provided as arguments. This allows tailored actions to be performed based on the provided log files.

  • Log Monitoring Capability
    A new command has been added to continuously monitor the logs using "bin/docker-compose exec phpfpm tail -f". This update will ensure we are immediately updated about the latest changes or issues that might occur.

@YevhenZvieriev
Copy link
Contributor

YevhenZvieriev commented Feb 9, 2024

Hi, @bbakalov

Check this PR Added script for log viewer

@bbakalov
Copy link
Contributor Author

bbakalov commented Feb 9, 2024

Hi, @bbakalov

Check this PR Added script for log viewer

Hello @YevhenZvieriev your work looks cool. But I think it is also good to somehow combine your approach and mine.
As I see it, in your log viewer, there is no possibility to tail logs in real time.

@YevhenZvieriev
Copy link
Contributor

@bbakalov I added the possibility to tail logs in real-time in this commit

@bbakalov
Copy link
Contributor Author

bbakalov commented Feb 9, 2024

@bbakalov I added the possibility to tail logs in real-time in this commit

Jesus) you are the best)
Waiting while your code will be merge.

You made a good job. Thx)

@markshust
Copy link
Owner

Hey all,

I reviewed both PRs and I actually like this one a lot better. It's much simpler, and it "just works" as I would expect it to work. I ran bin/log and the logs were immediately outputted. Then tested with --help and then bin/log system.log, and it just worked... immediately.

I see no reason to not move forward with this script. I appreciate both of your efforts and hate to choose between two nicely-written PRs, but I think this one wins out for it's simplicity and lack of UI -- it's more intuitive.

@markshust markshust merged commit defde77 into markshust:master Feb 24, 2024
1 check passed
@what-the-diff what-the-diff bot mentioned this pull request Feb 25, 2024
@pratikgiramkar1
Copy link

Hey, my setup doesn't generate logs at all, when I completed the setup there was no system.log file present, debug.log file was present with some existing logs, after that I tried multiple things to generate logs but nothing worked, kindly guide me fix this.

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.

4 participants