Download the PHP package caixingyue/laravel-star-log without Composer

On this page you can find all versions of the php package caixingyue/laravel-star-log. 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 laravel-star-log

Rebuild the log structure based on laravel log

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is a package that enhances the Laravel log format. It can inject request ID, craftsman ID, queue ID, and supports enhanced capabilities such as routing request log, HTTP client request log, SQL Query log, etc.

Installation

You can install the package via composer:

You can publish the config file with:

Usage

Log format configuration

After the installation is complete, you need to add a new information to the configuration file. The following is a common reference example, you can modify the configuration as needed.

Injecting request ID

If you wish to inject the , you may append it to the global stack in your application's file:

Enable request logging

If you would like clients to automatically log request and response information when they request your routes, you may attach this to the global stack in your application's file:

Routing Configuration

Sometimes we want to return the request ID in the response header when responding to troubleshoot problems. Or we may not want to record request logs for certain URLs or methods, or even secret field information. For these situations, you can add relevant configuration to the configuration file:

When you want to return the request ID in the response, you can set to in the configuration.

If you do not want to record request logs for certain URLs, you can add the information to be excluded in the .

If you do not want to record requests of certain methods, such as , , etc., you can add the information to be excluded in .

For some secret information fields that you do not want to be recorded in the log, you can add the relevant field name in the field, and the system will automatically replace the data with before recording the data. Currently, we have configured the common fields , , and as secret fields, which can be adjusted if necessary.

Injecting Artisan ID

If you wish to inject the , you may use the method in your command class:

Injecting Queue ID

If you wish to inject the , you may use the method in your job class:

Generally, only can use the . If also needs to use it, you can call in to initialize it.

Enable HTTP client request logging

If you want the system to automatically log requests and responses when making HTTP client requests, you can set to in the configuration.

For some secret information fields that you do not want to be recorded in the log, you can add the relevant field name in the field, and the system will automatically replace the data with before recording the data. Currently, we have configured the common fields , , and as secret fields, which can be adjusted if necessary.

Enable SQL Query logging

If you want the system to automatically log when SQL queries are issued, you can set to in the configuration.

If you do not want to record certain SQL queries, you can add the SQL to be excluded in the except. The SQL statement to be excluded does not have to be complete, as long as it is a part of the SQL.

By default, we will exclude SQL operations on laravel basic tables. If necessary, you can adjust them as needed.

In the exclusion, * key means that it has effect in all class methods. If you need to limit the restrictions within a class, you can specify the class name as the key, such as .

Helpers

We provide some helpers that can help you get some data in different scenarios.

Generally, in classes that use injected id, we recommend using the $this method.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-star-log with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0
jenssegers/agent Version ^2.6
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 caixingyue/laravel-star-log contains the following files

Loading the files please wait ....