Download the PHP package ampersand/magento2-verbose-log-request without Composer

On this page you can find all versions of the php package ampersand/magento2-verbose-log-request. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-verbose-log-request

magento2-verbose-log-request

Build Status

Summary

Dynamically change the log level per request to DEBUG. This enables database, debug log, and verbose logging for a specifically defined request.

Pass in a X-Verbose-Log header and Magento will activate the kind of logging you usually only have in developer mode for that request.

This means you can get verbose information when you are debugging something on production without having to switch on these settings forcefully. This is beneficial as on high traffic sites this can produce a lot of log data and narrowing in for what you are interested in can be difficult otherwise.

It is recommended that you also install ampersand/magento2-log-correlation-id to help correlate your log entries together.

Compatible with Magento 2.4.1 and higher.

Features

Example Usage

On the system you want to debug run the following command to get the current key

Make a request to your desired page with an X-Verbose-Log header set to that value

or

See all your verbose log files

If you want to do more complex interactions you could use something like modheader to set this value for a series of requests, be aware that will output a LOT of debug data.

Installation

Composer require the module.

Run module installation, this will generate your ampersand/verbose_log_request/key in app/etc/config.php, commit this change.

Update your .gitignore to ignore

If you want to give certain admin users permissions to get the key via the Admin Panel -> Account Settings -> Get Verbose Log Key create app/etc/di.xml_ampersand_magento2_verbose_log_request/allowed_emails_di.xml and define the allowed emails/domains.

Security considerations

As all we are doing is writing to the log files the biggest "risk" is to your disk space.

However as you need to know the key to trigger the logging it can be locked down to your developers and won't be accessible to the outside world unless they already have access to your file system.

A log level below "debug", the VerboseDebugLogger

By default magento has debug level logging enabled on developer mode and it may even be activated on some production environments. As we want to log cache_load and cache_save information this would rapidly fill up your log files on either your developer machine, or those production enivornments with lots of unnecessary data.

To ensure we only trigger these extra verbose debug level logging when the X-Verbose-Log request is flagged, we have a virtual type that you can inject into your classes.

Ampersand\VerboseLogRequest\Logger\VerboseDebugLogger will write to the ./var/log/debug.log file the same as the standard calls to ->debug(), but they will only write when flagged to in the request.

In this manner we can spoof in a sort of log level below DEBUG as defined in RFC 5424. It is still a debug log, but it is only triggered when specifically requested and is therefore a bit separate from standard debug logs.

You can tell your class to use this kind of debug logging by injecting it in place of the standard \Psr\Log\LoggerInterface by defining a di.xml like so

It's great for adding hotfix logging

We all hope that it is never necessary but if you ever feel the need to add some hotfix logging onto an environment you can improve it by using the VerboseDebugLogger

Inject that dependency (as described above) and you can put debug statements all through your application that will only trigger when you request it on the problematic environment.


All versions of magento2-verbose-log-request with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4||^8.1
magento/framework Version >=103.0.1
magento/magento-composer-installer Version *
magento/module-developer Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ampersand/magento2-verbose-log-request contains the following files

Loading the files please wait ....