Download the PHP package ucan-lab/laravel-blink-logger without Composer
On this page you can find all versions of the php package ucan-lab/laravel-blink-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-blink-logger
Laravel Blink Logger
English | 日本語
Comprehensive Logging Tool for Laravel.
Requirements
| Package | Version |
|---|---|
| PHP | ^8.3 |
| Laravel | ^12.0 / ^13.0 |
[!NOTE] Laravel 11 and PHP 8.2 are no longer supported as of this major release: the minimum PHP version is raised to 8.3, and Laravel support is narrowed to 12 and 13. If you are on Laravel 11 or PHP 8.2, please upgrade before installing this version, or stay on the previous major line.
Installation
Require this package with composer. It is recommended to only require the package for development.
Debug log output is disabled by default, so please enable it in .env.
[Option] Publish the config file
Copy the package config to your local config with the publish command:
Configuration
After publishing the config file, you can configure the following options in config/blink-logger.php.
Redaction (redact)
Sensitive values are masked before they reach the log output. Redaction applies to all loggers (HTTP request/response, HTTP client request/response).
| Key | Default | Description |
|---|---|---|
redact.placeholder |
*** |
String used to replace redacted values. |
redact.headers |
See config | List of header names (case-insensitive) whose values are replaced by the placeholder. Defaults include authorization, cookie, set-cookie, x-api-key, x-xsrf-token, proxy-authorization, php-auth-pw, x-auth-token, and x-access-token. |
redact.body_keys |
See config | List of request/response body keys (case-insensitive, recursive) whose values are replaced by the placeholder. Defaults include password, token, access_token, refresh_token, secret, api_key, authorization, credit_card, card_number, cvv, client_secret, private_key, and passphrase. |
URL query string masking: Parameters in the URL query string (e.g. ?token=secret) are also masked when their key matches redact.body_keys. This applies to both incoming HTTP request URLs and outgoing HTTP client request URLs.
Non-JSON response bodies: Body key masking is applied only when the response body is parseable as JSON (Content-Type: application/json, application/ld+json, application/*+json, or text/json). Raw string response bodies are logged as-is without key-based masking.
To customize the redact lists, publish the config file and edit config/blink-logger.php.
Query Logger (query)
| Key | Default | Env Variable | Description |
|---|---|---|---|
query.enabled |
false |
LOG_QUERY_ENABLED |
Enable or disable query logging. |
query.channel |
config('logging.default') |
— | Log channel to write query logs to. |
query.slow_query_time |
2000 |
LOG_SQL_SLOW_QUERY_TIME |
Threshold in milliseconds. Queries that exceed this value are logged at warning level instead of debug. |
query.redact_bindings |
false |
LOG_SQL_REDACT_BINDINGS |
When true, SQL bindings are not interpolated into the query string. The raw parameterized SQL (with ? placeholders) is logged instead, preventing binding values from appearing in logs. Defaults to false to preserve existing behavior. |
[!WARNING] When
query.enabledistrueandquery.redact_bindingsisfalse(the default), SQL binding values — including passwords, tokens, and other sensitive data — are interpolated into the logged SQL string and appear in plain text in your logs. If you enable query logging in production, setLOG_SQL_REDACT_BINDINGS=trueto prevent sensitive binding values from leaking into log output. |query.listeners| See config | — | Map of database event classes to listener classes. CoversQueryExecuted,TransactionBeginning,TransactionCommitted, andTransactionRolledBack. |
HTTP Request Logger (http.request)
| Key | Default | Env Variable | Description |
|---|---|---|---|
http.request.enabled |
false |
LOG_HTTP_REQUEST_ENABLED |
Enable or disable incoming HTTP request logging. |
http.request.channel |
config('logging.default') |
— | Log channel to write HTTP request logs to. |
http.request.include_paths |
[] |
— | If non-empty, only requests whose path matches one of these values are logged (supports * wildcard patterns via Laravel's Request::is(), e.g. api/*; exact strings also match). Takes precedence over exclude_paths. |
http.request.exclude_paths |
[] |
— | When include_paths is empty, requests whose path matches any of these values are skipped (supports * wildcard patterns via Laravel's Request::is(), e.g. admin/*; exact strings also match). Has no effect when include_paths is non-empty. |
http.request.middleware_group_names |
['web', 'api'] |
— | Middleware groups the request logger middleware is registered to. |
HTTP Response Logger (http.response)
| Key | Default | Env Variable | Description |
|---|---|---|---|
http.response.enabled |
false |
LOG_HTTP_RESPONSE_ENABLED |
Enable or disable incoming HTTP response logging. |
http.response.channel |
config('logging.default') |
— | Log channel to write HTTP response logs to. |
http.response.include_paths |
[] |
— | If non-empty, only responses whose path matches one of these values are logged (supports * wildcard patterns via Laravel's Request::is(), e.g. api/*; exact strings also match). Takes precedence over exclude_paths. |
http.response.exclude_paths |
[] |
— | When include_paths is empty, responses whose path matches any of these values are skipped (supports * wildcard patterns via Laravel's Request::is(), e.g. admin/*; exact strings also match). Has no effect when include_paths is non-empty. |
http.response.middleware_group_names |
['api'] |
— | Middleware groups the response logger middleware is registered to. |
HTTP Client Request Logger (http_client.request)
| Key | Default | Env Variable | Description |
|---|---|---|---|
http_client.request.enabled |
false |
LOG_HTTP_CLIENT_REQUEST_ENABLED |
Enable or disable outgoing HTTP client request logging. |
http_client.request.channel |
config('logging.default') |
— | Log channel to write HTTP client request logs to. |
HTTP Client Response Logger (http_client.response)
| Key | Default | Env Variable | Description |
|---|---|---|---|
http_client.response.enabled |
false |
LOG_HTTP_CLIENT_RESPONSE_ENABLED |
Enable or disable outgoing HTTP client response logging. |
http_client.response.channel |
config('logging.default') |
— | Log channel to write HTTP client response logs to. |
Usage
Watch the log file.
Example logs.