Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robertsaupe/php-logger
php library to create a logger
https://github.com/robertsaupe/php-logger
filelog filelogger html htmllogger htmllogging library log logger logging php php8
Last synced: about 2 months ago
JSON representation
php library to create a logger
- Host: GitHub
- URL: https://github.com/robertsaupe/php-logger
- Owner: robertsaupe
- License: mit
- Created: 2022-06-01T10:08:06.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-21T10:24:19.000Z (11 months ago)
- Last Synced: 2024-07-28T21:50:24.480Z (5 months ago)
- Topics: filelog, filelogger, html, htmllogger, htmllogging, library, log, logger, logging, php, php8
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# php-logger
[![Minimum PHP version: 8.2](https://img.shields.io/badge/php-8.2%2B-blue.svg?color=blue&style=for-the-badge)](https://packagist.org/packages/robertsaupe/php-logger)
[![Packagist Version](https://img.shields.io/packagist/v/robertsaupe/php-logger?color=blue&style=for-the-badge)](https://packagist.org/packages/robertsaupe/php-logger)
[![Packagist Downloads](https://img.shields.io/packagist/dt/robertsaupe/php-logger?color=blue&style=for-the-badge)](https://packagist.org/packages/robertsaupe/php-logger)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](LICENSE)php library to create a logger
## Supporting
[GitHub](https://github.com/sponsors/robertsaupe) |
[Patreon](https://www.patreon.com/robertsaupe) |
[PayPal](https://www.paypal.com/donate?hosted_button_id=SQMRNY8YVPCZQ) |
[Amazon](https://www.amazon.de/ref=as_li_ss_tl?ie=UTF8&linkCode=ll2&tag=robertsaupe-21&linkId=b79bc86cee906816af515980cb1db95e&language=de_DE)## Installing
```sh
composer require robertsaupe/php-logger
```## Getting started
### Basic
```php
use robertsaupe\Logger\LogBasic;$logger = new LogBasic();
$logger->error('error');
$logger->warning('warning');
$logger->info('info');
$logger->normal('normal');
$logger->verbose('verbose');
$logger->veryverbose('veryverbose');
$logger->debug('debug');//return messageObject
$message = $logger->normal("Testmessage");
print_r($message);
print_r($message->getArray());//return all messages
print($logger->getFormattedMessagesByVerbosity());//return all messages as html
print($logger->getFormattedMessagesByVerbosity(true));
```### File
```php
use robertsaupe\Logger\LogFile;$logger = new LogFile(dirname(__DIR__).'/logs', 'test');
//now writes the messages to a log-file
```### HTML
```php
use robertsaupe\Logger\LogHTML;$logger = new LogHTML(dirname(__DIR__).'/logs', 'test');
//now writes the messages to a html-file
```## Credits
- [Symfony](https://github.com/symfony) for [Filesystem](https://symfony.com/doc/current/components/filesystem.html)