Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uniwue-rz/lyra-log
Lyra Log
https://github.com/uniwue-rz/lyra-log
logging lyra monolog php symfony
Last synced: 15 days ago
JSON representation
Lyra Log
- Host: GitHub
- URL: https://github.com/uniwue-rz/lyra-log
- Owner: uniwue-rz
- License: mit
- Created: 2017-07-20T15:44:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T12:45:44.000Z (over 7 years ago)
- Last Synced: 2024-10-17T15:49:10.059Z (about 1 month ago)
- Topics: logging, lyra, monolog, php, symfony
- Language: PHP
- Size: 10.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lyra Log
This is the log interface of the ***Lyra*** library. It is based on the `MonoLog` and can be customized to suite your needs. It contains two part: a Logger and a log handler. At the moment the handler supports the `Syslog`, PHP's `ErrorLog`, `Stdio` and `Stream` logging. The logger should work out of box which just creating the default handler and logger.## Installation
**Lyra Log** is available in `packagist`, so you only need to add the package to your composer file to use it.```bash
composer require rzuw/lyra-log
```You can also clone or fork this repository in github and work with your own implementation:
```bash
git clone ssh://[email protected]/uniwue-rz/lyra-log.git
```
Then add it as local folder in composer:
```json
{
"repositories": [
{
"type": "path",
"url": "/path-to-git-clone"
}
],
"require": {
"rzuw/lyra-log": "*"
}
}
```
Or add directly from the git repository:
```json
{
"require": {
"rzuw/lyra-log": "*"
},
"repositories": [
{
"type": "vcs",
"url": "ssh://[email protected]/uniwue-rz/lyra-log.git"
}
]
}
```## Configuration
The configuration for the logger is very simple:You need to create an instance of Logger with the given name. The name will always show up in the logs as `name.[LOG-LEVEL]`. Then add the handlers to the instance so the data is logged is accordingly. The rest of the work is done by Monolog. More information can be found in usage example.
## Usage
You should include all the needed files, then create the logger and log handler. Afterwards you can
use it whenever you want.```php
$logger = new Logger("name");
$handler = new LogHandlerFactory(
"StdErr", "DEBUG", array("bubble"=>false));
$logger->setHandlers(array($handler));
$logger->getLogger()->info("This is an INFO message");
```## Test
If you want to develop or debug this application you will need `phpunit` installed on your system. Then running:```bash
composer install
phpunit
```
in root folder of this library will test the code.## License
See LICENSE file.