Skip to content

This project designed for managing and analyzing Magento 2 logs.

License

Notifications You must be signed in to change notification settings

YevhenZvieriev/magento-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Magento 2 Log Management Script

Overview

Simplify and streamline your Magento 2 log management with this powerful bash script. This project, created by a Magento developer for Magento developers, offers an easy-to-use interface for viewing, tailing, and searching errors in your log files from your Magento 2 project in real time. Enhance your debugging and monitoring capabilities with color-coded log entries for better readability and quick issue identification.

Features

  • Tail Logs in Real-Time: Effortlessly tail all or specific log files directly from your Docker container, with color-coded output for ERROR, WARNING, INFO, and DEBUG messages.
  • View Log Files: Quickly view the content of specific log files without leaving the command line.
  • Search for Errors: Automatically search for and highlight ERROR, FATAL, CRITICAL, WARNING, INFO, and DEBUG messages in your log files.
  • Customizable Options: Easily configure the path to your log files and the Docker container name, tailored to fit your specific setup.
  • Interactive Menu: A user-friendly interactive menu to choose from various log management operations.

Usage

Screenshot from 2024-06-08 10-22-41

1. View existing log files:

Screencast.from.2024-06-08.10-24-18.mp4

2. Display the content of any specific log file directly from the Docker container:

Screencast.from.2024-06-08.10-28-22.mp4

3. Search Errors: Automatically search and highlight errors and warnings across all log files:

Screencast_from_2024-06-09_20-44-58.mp4

4. Tail Logs: Monitor logs in real-time with an option to view all logs or only error logs:

Screencast_from_2024-06-08_10-37-37.mp4
Screencast.from.2024-06-08.10-43-25.mp4

5. Configure Options: Set custom log file paths and container names according to your environment setup:

Screencast.from.2024-06-08.10-45-55.mp4

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 сurrent value.

For example, your log files are found in the /var/log/Amasty/ folder, you can easily view them using this option:

Screencast.from.2024-06-08.11-03-31.mp4

Also, if your log files are found in the /var/log/Amasty/ folder using bin/log -t Amasty/some.log Amasty/some2.log OR bin/log --tail Amasty/some.log Amasty/some2.log you can easily view them.

6. Possibility to execute the bin/log script with arguments

Using bin/log -h or bin/log --help script displays help information, including a script description, examples of its use, arguments, and options:

Screenshot from 2024-06-17 14-11-46

Using bin/log --tail cron.log system.log OR bin/log -t system.log cron.log to shorten, you can monitor logs in real-time for two or more log files:

Screencast_from_2024-06-08_10-48-59.mp4

Installation

Download the bash script inside the bin folder of your Magento 2 project

curl -O https://raw.githubusercontent.com/YevhenZvieriev/magento-logs/main/bin/log

Now you can make the bash script executable:

chmod +x ./log

How to use

  1. Run the script:
./bin/log
  1. Follow the on-screen menu to select the desired action.

Contributions

Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

Given the length of the script, I've provided comments to help people understand if they would like to contribute.

License

This project is licensed under the MIT License.

Copyright

(c) Yevhen Zvieriev

About

This project designed for managing and analyzing Magento 2 logs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages