Download the PHP package justrau/laravel-pretty-slack-logs without Composer
On this page you can find all versions of the php package justrau/laravel-pretty-slack-logs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justrau/laravel-pretty-slack-logs
More information about justrau/laravel-pretty-slack-logs
Files in justrau/laravel-pretty-slack-logs
Package laravel-pretty-slack-logs
Short Description Pretty Slack log channel for Laravel — formats errors as rich Block Kit messages with request context, git/host info, app-frame Location, Caused-by chains, and JSON context.
License MIT
Homepage https://github.com/justrau/laravel-pretty-slack-logs
Informations about the package laravel-pretty-slack-logs
laravel-pretty-slack-logs
A drop-in Slack log channel for Laravel that turns the noisy default error dump into a structured, color-coded Block Kit message — with HTTP request context, git/host info, app-frame Location, Caused-by chains, and JSON context.
Screenshots
A domain-level error wrapping a vendor-side cause — env header, request context, app-frame Location, stack trace, and the chained Caused by.
Log::critical(...) with a structured context array — rendered as pretty-printed JSON.
Illuminate\Database\QueryException with the SQL embedded in the message and a Caused by PDOException in the trace below (cropped).
What you get
Every error sent to Slack includes:
- Color sidebar per log level (warning / error / critical / emergency)
- Header with severity emoji, level, and exception class (or message)
- Environment line:
local · MyApp · a1b2c3d (main) · host: web-1 - Message in a code block
- Location — the first non-vendor stack frame with
file:line — Class::method(), plus a separate "Thrown at" line if the throw site differs - Request context for HTTP requests: method, URL, route name, IP, authenticated user, user-agent
- Console context for artisan commands: full command line
- Stack (app frames) — top frames excluding
vendor/and entry points - Caused by chain — each previous exception rendered with the same Location-style format
- Context — any
Log::error('msg', [...context])array, pretty-printed JSON - Footer with timestamp
Long fields are automatically truncated with a … (truncated) marker so messages never blow Slack's block size limits.
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
- A Slack Incoming Webhook URL
Install
Configure
Add a channel to config/logging.php:
Then add to .env:
That's it. Errors logged at or above LOG_SLACK_LEVEL will be posted to Slack.
Usage
Anything that hits the configured channel gets formatted automatically:
Configuration options
| Key | Default | Description |
|---|---|---|
url |
none | Slack webhook URL. If empty, the handler silently no-ops. |
level |
error |
Minimum log level to send (debug, info, notice, warning, error, critical, alert, emergency). |
name |
pretty-slack |
The Monolog channel name attached to each record. |
License
MIT — see LICENSE.
All versions of laravel-pretty-slack-logs with dependencies
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/log Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
monolog/monolog Version ^3.0