camuthig/laravel-segmentedsyslog

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (1.0.0) of this package.

A Laravel Syslog Handler to handle maximum message lengths enforced by certain syslog implementations.

1.0.0 2015-10-23 03:35 UTC

This package is auto-updated.

Last update: 2022-10-29 01:54:53 UTC


README

Laravel Segmented Syslog provides an extension on the normal Laravel syslog service to enable breaking up log messages into chunks to fit into the maximum allowed length defined by different syslog implementations. Each messsage will include a message identifier as well as a total number of segments and the current segment number

The section below shows an example of the format. The identifier here would be 56290be46d:1:2 and 56290be46d:2:2

  Oct 22 09:16:36 computer.local laravel[34348]: test.DEBUG: 56290be46d:1:2 Debug log with a lot of [] []
  Oct 22 09:16:36 computer.local laravel[34348]: test.DEBUG: 56290be46d:2:2 text to display [] []

Requirements

Segmented Syslog is tested on Laravel version 4.2 and will work on any PHP system >= 5.3

Setup

  1. Install segmented syslog
composer require camuthig/laravel-segmentedsyslog:dev-master
  1. Replace the standard LogServiceProvider for SegmentedSyslogServiceProvider in config/app.php. Don't worry, the provider extends the base Laravel provider, so all functionality is still available.
'providers' => array(
  ...
  // 'Illuminate\Log\LogServiceProvider',
	'Camuthig\SegmentedSyslog\SegmentedSyslogServiceProvider',
	...
),
  1. Update your Log handler in global.php
Log::useSegmentedSyslog();

Configuration

When declaring the Log facade to use the segmented syslog, you are able to configure all of the properties for the syslog, with the parameters as follows

public function useSegmentedSyslog(
      $name = 'laravel',
      $level = 'debug',
      $length = 1024,
      $facility = LOG_USER,
      $bubble = true,
      $logopts = LOG_PID
  )