2017 © Pedro Peláez
 

library gelf-server

Simple PHP server for GELF logger

image

keboola/gelf-server

Simple PHP server for GELF logger

  • Wednesday, July 11, 2018
  • by Keboola
  • Repository
  • 8 Watchers
  • 0 Stars
  • 5,160 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 6 % Grown

The README.md

GELF server GitHub Actions

A php implementation of a gelf compatible backend like Graylog2. This library provides a simple server to which a GELF client can connect., (*1)

Installation

Recommended installation via composer:, (*2)

Add gelf-server to composer.json either by running composer require keboola/gelf-server or by defining it manually:, (*3)

"require": {
   // ...
   "keboola/gelf-server": "^1.1"
   // ...
}

Reinstall dependencies: composer install, (*4)

Usage

To create a server, use the ServerFactory class:, (*5)

$server = ServerFactory::createServer(ServerFactory::SERVER_TCP);

To start listening for connections, us the start method. This method has the following parameters:, (*6)

  • $minPort and $maxPort - to set port on which the server listens. To listen on a single port use the same value for both $minPort and $maxPort. Otherwise the server will randomly choose a free port in the specified range (inclusive).
  • $onStart - Callback executed when the server successfully started listening, the callback signature is function ($port), which gives you the actual port the server is listening on.
  • $onProcess - Callback executed periodically when the server is running. The callback has signature function (&$terminated). The server will keep running indefinitely until you set $terminated to true in this callback.
  • $onEvent - Callback executed when a GELF event is received. The callback has signature function ($event). The $event variable contains associative array with GELF fields
  • $onTerminate - Optional callback executed when the server terminates - after it stops listening for connections. The callback signature is function ().

Examples

For usage examples, see the /examples directory., (*7)

License

MIT licensed, see LICENSE file., (*8)

The Versions

11/07 2018

dev-odin-symfony-forward

dev-odin-symfony-forward

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola

18/05 2018

dev-master

9999999-dev

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola
by Ondrej Popelka

18/05 2018

1.2.1

1.2.1.0

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola

18/05 2018

dev-odin-exception

dev-odin-exception

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola

13/05 2018

1.2.0

1.2.0.0

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola

03/09 2017

1.1.1

1.1.1.0

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola

29/08 2017

1.1.0

1.1.0.0

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola

29/08 2017

dev-error-handling

dev-error-handling

Simple PHP server for GELF logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Keboola