LaravelPackages.net
Acme Inc.
Toggle sidebar
afsdev/laravel-ray-log-channel

Log messages using Spatie Ray

66
1
v1.0.1
About afsdev/laravel-ray-log-channel

afsdev/laravel-ray-log-channel is a Laravel package for log messages using spatie ray. It currently has 1 GitHub stars and 66 downloads on Packagist (latest version v1.0.1). Install it with composer require afsdev/laravel-ray-log-channel. Discover more Laravel packages by afsdev or browse all Laravel packages to compare alternatives.

Last updated

Laravel Ray Logging

A log channel that sends all laravel logging through Ray.

Using Ray to monitor log messages makes debugging during development easier more convenient to tailing the laravel log, but it can also be useful when monitoring production applications through SSH.

Features

  • Allows dumping complex data structures (models, large arrays, etc) that don't translate well to text only log files
  • Each level can be assigned to a different color, which also allows it to be filtered
  • The filename and line number of the log message is included in each log, so one click brings your editor to the exact place the log message was called
  • Minimum log level and colors are configurable

Examples

Install

You can install this package via composer using this commands:

composer require afsdev/laravel-ray-log-channel

Configuration

Add the channel to config/logging.php

'channels' => [
  ...
  'ray' => [
    'driver' => 'ray',
    'level' => 'debug',
  ]
]

Use the log channel in .env :

LOG_CHANNEL=ray

Optionally, you can customize the used colors for each level:

'ray' => [
  'driver' => 'ray',
  'level' => 'debug',
  'colors' => [ 
      'blue' => ['DEBUG', 'INFO'],
      'green' => ['NOTICE'],
      'yellow' => ['WARNING'],
      'red' => ['ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY', 'API'],
  ]
]

Star History Chart