PHPackages                             arashdalir/php-psr3log - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. arashdalir/php-psr3log

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

arashdalir/php-psr3log
======================

This is an extension of lvht\\updlog's SysLog over UDP implementation, meant to make the library extendable and also make it possible to use the same format for other log destinations.

v1.1.0(7y ago)014PHPPHP ^5.6

Since Jun 12Pushed 7y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

PHP-Psr3Log
===========

[](#php-psr3log)

`ArashDalir\Psr3Log` is a [PSR3](http://www.php-fig.org/psr/psr-3/) implementation, which sending log according [RFC 5424](https://tools.ietf.org/html/rfc5424). This library forks the implementation of UDP-Based SysLog library implemented as [lvht\\updlog](https://github.com/lvht/udplog), generalises it and allows further extension of the base system.

Install
-------

[](#install)

Use following command to add the repository to your project:

```
composer require arashdalir/php-psr3log:dev-master

```

Or add following line to your composer.json:

```
{
  "require": {
     "arashdalir/php-psr3log": "dev-master"
  }
}
```

Usage
-----

[](#usage)

Currently, there is only one realization of Psr3Log Handlers for SysLog over UDP format and local SysLog.

### Local SysLog:

[](#local-syslog)

By not defining an address when creating an object, the object tries to write the values in local syslog.

### UDP-Based SysLog Client:

[](#udp-based-syslog-client)

The constructor function accepts an IP-Address and a port where the syslog server is, and will send logs to the remote server.

#### Usage on Windows:

[](#usage-on-windows)

Please note that on Windows [only LOG\_USER facility is allowed](http://php.net/manual/en/function.openlog.php). Using other facilities will throw an Exception of type `ArashDalir\Handler\SysLog\InvalidFacilityException`, if the second parameter for `setFacility($facility, $os_form)` is set to true.

```
