Download the PHP package bit-mx/saloon-logger-plug-in without Composer

On this page you can find all versions of the php package bit-mx/saloon-logger-plug-in. 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 saloon-logger-plug-in

Saloon Logger Plug-in

A Laravel plug-in for the Saloon HTTP client Saloon v4 that provides automatic observability and traceability for all HTTP interactions made with the Saloon library.

This package transparently logs requests, responses and exceptions to the database, and links all events using a single trace_id (ULID).

Features

Installation

Requirements

Install via Composer

Install the package using Composer:

composer require bit-mx/saloon-logger-plug-in

Publish and run migrations

This command will publish the migration into your database/migrations directory:

php artisan vendor:publish --tag=saloon-logger-migrations

Then run the migrations:

php artisan migrate

Publish configuration (optional)

You can publish the configuration file to customize which fields are censored:

php artisan vendor:publish --tag=saloon-logger-config

This will create config/saloon-logger.php.

Usage

Step 1: Apply the Traits

To enable traceability, add the HasLogging trait to your connector and the ProvidesDefaultBody trait to your request.

Connector example:

Request example:

Step 2: Send the Request

Whenever a request is sent through this connector, the package will automatically log the events to the database table.

If an HTTP or network exception occurs (for example a 500), the package will log the request and the exception.

Other languages

Spanish

Custom sanitizers

If you need a custom way to sanitize payloads or headers before they are stored, implement the SanitizerRequestContract and register your class in the package configuration under the sanitizers.request array.

Example request custom sanitizer:

If you need a custom way to sanitize the response before they are stored, implement the SanitizerResponseContract and register your class in the package configuration under the sanitizers.response array.

Example Response custom sanitizer:

Then register it in config/saloon-logger.php:

Sanitizers are applied in the order they appear in the configuration. Each sanitizer receives the data and must return the updated value.

Prune & Backup

You can configure the package to prune old records and make a backup of the records. The options are available separately in the configuration file


All versions of saloon-logger-plug-in with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^12.39|^13.0
saloonphp/saloon Version ^4.0
saloonphp/laravel-plugin Version ^4.0
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 bit-mx/saloon-logger-plug-in contains the following files

Loading the files please wait ...