• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..20-May-2021-

src/Monolog/H20-May-2021-12,9696,808

CHANGELOG.mdH A D14-Dec-202031.6 KiB523417

LICENSEH A D14-Dec-20201 KiB2016

README.mdH A D14-Dec-20205.1 KiB11075

UPGRADE.mdH A D14-Dec-20202.8 KiB7348

composer.jsonH A D14-Dec-20202.6 KiB7372

phpstan.neon.distH A D14-Dec-2020840 2117

README.md

1# Monolog - Logging for PHP [![Build Status](https://travis-ci.org/Seldaek/monolog.svg?branch=master)](https://travis-ci.org/Seldaek/monolog)
2
3[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
4[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
5
6
7Monolog sends your logs to files, sockets, inboxes, databases and various
8web services. See the complete list of handlers below. Special handlers
9allow you to build advanced logging strategies.
10
11This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
12interface that you can type-hint against in your own libraries to keep
13a maximum of interoperability. You can also use it in your applications to
14make sure you can always use another compatible logger at a later time.
15As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels.
16Internally Monolog still uses its own level scheme since it predates PSR-3.
17
18## Installation
19
20Install the latest version with
21
22```bash
23$ composer require monolog/monolog
24```
25
26## Basic Usage
27
28```php
29<?php
30
31use Monolog\Logger;
32use Monolog\Handler\StreamHandler;
33
34// create a log channel
35$log = new Logger('name');
36$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
37
38// add records to the log
39$log->warning('Foo');
40$log->error('Bar');
41```
42
43## Documentation
44
45- [Usage Instructions](doc/01-usage.md)
46- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md)
47- [Utility Classes](doc/03-utilities.md)
48- [Extending Monolog](doc/04-extending.md)
49- [Log Record Structure](doc/message-structure.md)
50
51## Support Monolog Financially
52
53Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek).
54
55Tidelift delivers commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.
56
57## Third Party Packages
58
59Third party handlers, formatters and processors are
60[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
61can also add your own there if you publish one.
62
63## About
64
65### Requirements
66
67- Monolog `^2.0` works with PHP 7.2 or above, use Monolog `^1.25` for PHP 5.3+ support.
68
69### Support
70
71Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 where possible to benefit from all the latest features and fixes.
72
73### Submitting bugs and feature requests
74
75Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues)
76
77### Framework Integrations
78
79- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
80  can be used very easily with Monolog since it implements the interface.
81- [Symfony](http://symfony.com) comes out of the box with Monolog.
82- [Laravel](http://laravel.com/) comes out of the box with Monolog.
83- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog.
84- [PPI](https://github.com/ppi/framework) comes out of the box with Monolog.
85- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin.
86- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer.
87- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog.
88- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog.
89- [Nette Framework](http://nette.org/en/) can be used with Monolog via [contributte/monolog](https://github.com/contributte/monolog) extension.
90- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog.
91- [FuelPHP](http://fuelphp.com/) comes out of the box with Monolog.
92- [Equip Framework](https://github.com/equip/framework) comes out of the box with Monolog.
93- [Yii 2](http://www.yiiframework.com/) is usable with Monolog via the [yii2-monolog](https://github.com/merorafael/yii2-monolog) or [yii2-psr-log-target](https://github.com/samdark/yii2-psr-log-target) plugins.
94- [Hawkbit Micro Framework](https://github.com/HawkBitPhp/hawkbit) comes out of the box with Monolog.
95- [SilverStripe 4](https://www.silverstripe.org/) comes out of the box with Monolog.
96
97### Author
98
99Jordi Boggiano - <j.boggiano@seld.be> - <http://twitter.com/seldaek><br />
100See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) who participated in this project.
101
102### License
103
104Monolog is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
105
106### Acknowledgements
107
108This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/)
109library, although most concepts have been adjusted to fit to the PHP world.
110