1# Monolog - Logging for PHP [![Build Status](https://img.shields.io/travis/Seldaek/monolog.svg)](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->addWarning('Foo');
40$log->addError('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
50## Third Party Packages
51
52Third party handlers, formatters and processors are
53[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
54can also add your own there if you publish one.
55
56## About
57
58### Requirements
59
60- Monolog works with PHP 5.3 or above, and is also tested to work with HHVM.
61
62### Submitting bugs and feature requests
63
64Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues)
65
66### Framework Integrations
67
68- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
69  can be used very easily with Monolog since it implements the interface.
70- [Symfony2](http://symfony.com) comes out of the box with Monolog.
71- [Silex](http://silex.sensiolabs.org/) comes out of the box with Monolog.
72- [Laravel 4 & 5](http://laravel.com/) come out of the box with Monolog.
73- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog.
74- [PPI](http://www.ppi.io/) comes out of the box with Monolog.
75- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin.
76- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer.
77- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog.
78- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog.
79- [Nette Framework](http://nette.org/en/) can be used with Monolog via [Kdyby/Monolog](https://github.com/Kdyby/Monolog) extension.
80- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog.
81
82### Author
83
84Jordi Boggiano - <j.boggiano@seld.be> - <http://twitter.com/seldaek><br />
85See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project.
86
87### License
88
89Monolog is licensed under the MIT License - see the `LICENSE` file for details
90
91### Acknowledgements
92
93This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/)
94library, although most concepts have been adjusted to fit to the PHP world.
95