Download the PHP package dittto/symfony-request-logger without Composer

On this page you can find all versions of the php package dittto/symfony-request-logger. 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 symfony-request-logger

Symfony request logger

What is it?

Any apps we write will, quite often, have cause to make external calls to either our own, or third-party, APIs. This Symfony bundle makes it easy to track how long these requests are taking and return the result via either monolog and/or an additional JSON object that's appended to your output when Symfony's in debug mode.

It works by adding extra middleware to Guzzle so we can track when a request is made and either succeeds or fails, and then storing these logs for later output.

How to set it up

Basic setup

There are a few different options for using this request logger. The most simple is to log all requests made via Guzzle, and then recall the logs later.

To do this, add / update the following services. If you've already got a Guzzle service, then update it as required:

What does this do then? The first service is to define which version of the request logger we're going to use. dittto.request_logger is the most basic form of LoggerInterface that simply stores all requests for later.

After that, we create a Guzzle client, and then make sure our middleware has been added to it, so we can store our API request attempts.

To use this, you'd probably do something like:

With monolog

Above shows how to use it and deal with the result yourself. Realistically, you're going to want to automatically output the request logger one way or another.

We'll use monolog to output our logged messages this time. To begin with, let's create a unique monolog channel for all of these messages:

Next, create the following services. If you've already defined Guzzle then just pick and choose the settings you wish to use:

Note that the changes this time are to the first two services. The alias now references dittto.request_logger.passthrough which allows us to save our logged messages to both our request logger, and monolog.

The second service is an alias to the new monolog channel we created above.

Now if you run your code, both monolog will save changes and the request logger has them available via getLogs().

If you're just going to use monolog for recording those messages, then you can use just the guzzle middleware instead of everything else. This is done using the following services:

JSON debug object

If you're building, maintaining, and debugging a lot of JSON APIs, then you can have this plugin automatically add your request logs to your JSON output when Symfony is in debug mode.

Add the following service to your app to capture valid responses and update your JSON:


All versions of symfony-request-logger with dependencies

PHP Build Version
Package Version
No informations.
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 dittto/symfony-request-logger contains the following files

Loading the files please wait ....