PHPackages                             khalyomede/syslog-interface - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. khalyomede/syslog-interface

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

khalyomede/syslog-interface
===========================

Standard proposal for Syslog protocol across any classes

v1.0.1(8y ago)0261MITPHPPHP &gt;=7.0.0

Since Mar 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/khalyomede/syslog-interface)[ Packagist](https://packagist.org/packages/khalyomede/syslog-interface)[ RSS](/packages/khalyomede-syslog-interface/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (1)

Syslog interface
================

[](#syslog-interface)

[![PHP from Packagist](https://camo.githubusercontent.com/ef305585b70e784f352493f66f45db0f4de3ba43344e847b37aa94db70a4c321/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b68616c796f6d6564652f7379736c6f672d696e746572666163652e737667)](https://camo.githubusercontent.com/ef305585b70e784f352493f66f45db0f4de3ba43344e847b37aa94db70a4c321/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b68616c796f6d6564652f7379736c6f672d696e746572666163652e737667)[![Packagist](https://camo.githubusercontent.com/5fcee4fe94f4c2b3b4613c8213f30120e83a4c0621dd5fa0ea8f3764556dd8ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b68616c796f6d6564652f7379736c6f672d696e746572666163652e737667)](https://camo.githubusercontent.com/5fcee4fe94f4c2b3b4613c8213f30120e83a4c0621dd5fa0ea8f3764556dd8ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b68616c796f6d6564652f7379736c6f672d696e746572666163652e737667)[![Packagist](https://camo.githubusercontent.com/f4646145c3392cfc9813fe833116a79b380567fe850059a70bccda68cebcbfdb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b68616c796f6d6564652f7379736c6f672d696e746572666163652e737667)](https://camo.githubusercontent.com/f4646145c3392cfc9813fe833116a79b380567fe850059a70bccda68cebcbfdb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b68616c796f6d6564652f7379736c6f672d696e746572666163652e737667)

Standard proposal for Syslog protocol across any classes.

```
class MyLog implements SyslogInterface {
  // ...
}
```

```
$log = new MyLog;

$log->warning('Request invalidated for user {userid}', ['userid' => 'John']);
```

Summary
-------

[](#summary)

- [Problem solved with this standard](#problem-solved-with-this-standard)
- [Installation](#installation)
- [Warnings](#warnings)
- [Methods definitions](#methods-definitions)
- [MIT Licence](#mit-licence)

Problem solved with this standard
---------------------------------

[](#problem-solved-with-this-standard)

This interface aim to bring a common strategy for various implementer of syslog solutions. It is based on [PSR-3 Log standard](https://www.php-fig.org/psr/psr-3/) (but does not implement its interface because of the lack of support for type hinting in method prototypes) and provide a overlay to it by following the [Syslog Protocol RFC 5424](https://tools.ietf.org/html/rfc5424).

Installation
------------

[](#installation)

In your project folder:

```
composer require khalyomede/syslog-interface:1.*
```

Warnings
--------

[](#warnings)

- No support for the [structured data](https://tools.ietf.org/html/rfc5424#section-7) for the moment

Methods definitions
-------------------

[](#methods-definitions)

- [`alert`](#alert)
- [`critical`](#critical)
- [`date`](#date)
- [`debug`](#debug)
- [`device`](#device)
- [`emergency`](#emergency)
- [`error`](#error)
- [`facility`](#facility)
- [`host`](#host)
- [`identifier`](#identifier)
- [`info`](#info)
- [`log`](#log)
- [`notice`](#notice)
- [`port`](#port)
- [`processus`](#processus)
- [`source`](#source)
- [`warning`](#warning)

### Alert

[](#alert)

Log a message with an alert severity level.

```
public function alert(string $message, array $context = []);
```

### Critical

[](#critical)

Log a message with a critical severity level.

```
public function critical(string $message, array $context = []);
```

Date
----

[](#date)

Force the date for the next log.

```
public function date(DateTime $date);
```

debug
-----

[](#debug)

Log a message with a debug severity log.

```
public function debug(string $message, array $context = []);
```

device
------

[](#device)

Set the originated device (mobile device, webcam, web server, ...) that generated the log.

```
public function device(string $device);
```

emergency
---------

[](#emergency)

Log a message with an emergency severity level.

```
public function emergency(string $message, array $context = []);
```

error
-----

[](#error)

Log a messae with an error severity level.

```
public function error(string $message, array $context = []);
```

facility
--------

[](#facility)

Represents the origin process. For a list of common facilities, follow [this link](https://tools.ietf.org/html/rfc5424#section-6.2.1).

```
public function facility(int $category);
```

host
----

[](#host)

Represents the machine that will receive the log.

```
public function host(string $host);
```

identifier
----------

[](#identifier)

An identifier (can be a string or an integer) that represents the serie of logs.

```
public function identifier(string $identifier);
```

info
----

[](#info)

Log a message with an info severity level.

```
public function info(string $message, array $context = []);
```

log
---

[](#log)

Log the message.

```
public function log(string $level, string $message, array $context = []);
```

notice
------

[](#notice)

Log a message with a notice severity level.

```
public function notice(string $message, array $context = []);
```

port
----

[](#port)

Set the port to log through.

```
public function port(int $port);
```

processus
---------

[](#processus)

Set the originated machine, device, ... that is responsible for generating the log.

```
public function processus(string $processus);
```

source
------

[](#source)

Set the originated domain that host the device. For more information check the [hostname property RFC5424](https://tools.ietf.org/html/rfc5424#section-6.2.4).

```
public function source(string $source);
```

**Note**

- The source should be a valid domain or ip
- The validation should be made via [`filter_var`](http://php.net/manual/en/function.filter-var.php) and prefix by `http://` if it is missing

warning
-------

[](#warning)

Log a message with a warning severity level.

```
public function warning(string $message, array $context = []);
```

MIT Licence
-----------

[](#mit-licence)

Syslog interface

Copyright © 2018 Khalyomede

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the oftware, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN CTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2962d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15908747?v=4)[Anwar](/maintainers/khalyomede)[@khalyomede](https://github.com/khalyomede)

---

Top Contributors

[![khalyomede](https://avatars.githubusercontent.com/u/15908747?v=4)](https://github.com/khalyomede "khalyomede (17 commits)")

---

Tags

interfacephpphp7syslog-interfacesyslog-messagessyslog-protocol

### Embed Badge

![Health badge](/badges/khalyomede-syslog-interface/health.svg)

```
[![Health](https://phpackages.com/badges/khalyomede-syslog-interface/health.svg)](https://phpackages.com/packages/khalyomede-syslog-interface)
```

###  Alternatives

[laracademy/generators

This package will generate a Laravel Model based on your database table itself, filling in the required fields automatically.

355346.4k4](/packages/laracademy-generators)[beyondcode/laravel-vouchers

Allow users to redeem vouchers that are bound to models..

70763.4k2](/packages/beyondcode-laravel-vouchers)[firegento/magesetup2

MageSetup provides the necessary configuration (system config, tax, agreements, etc. for a national market.

123328.5k1](/packages/firegento-magesetup2)[sixlive/nova-text-copy-field

Laravel Nova text field with click to copy support

70708.2k2](/packages/sixlive-nova-text-copy-field)[happyr/message-serializer

Serialize classes the good way.

80491.3k](/packages/happyr-message-serializer)[percymamedy/laravel-dev-booter

Boost your Laravel app by registering Prod services only on Prod.

35320.7k1](/packages/percymamedy-laravel-dev-booter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
