monolog | Sends your logs to files , sockets , inboxes , databases | Socket library

 by   Seldaek PHP Version: 3.3.1 License: MIT

kandi X-RAY | monolog Summary

kandi X-RAY | monolog Summary

monolog is a PHP library typically used in Networking, Socket, Nodejs applications. monolog has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Sends your logs to files, sockets, inboxes, databases and various web services

            kandi-support Support

              monolog has a medium active ecosystem.
              It has 20395 star(s) with 1870 fork(s). There are 316 watchers for this library.
              It had no major release in the last 12 months.
              There are 27 open issues and 742 have been closed. On average issues are closed in 106 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of monolog is 3.3.1

            kandi-Quality Quality

              monolog has 0 bugs and 0 code smells.

            kandi-Security Security

              monolog has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              monolog code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              monolog is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              monolog releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              monolog saves you 3125 person hours of effort in developing the same functionality from scratch.
              It has 6892 lines of code, 627 functions and 111 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed monolog and discovered the below as its top functions. This is intended to give you an instant insight into monolog implemented functionality, and help decide if they suit your requirements.
            • Get slack data .
            • Init connector .
            • Adds a record to the log .
            • Rotate the log file .
            • Handles a signal .
            • Convert PHP code to string .
            • Normalize data .
            • Build the message .
            • Collect the log messages .
            • Handle a single record
            Get all kandi verified functions for this library.

            monolog Key Features

            No Key Features are available at this moment for monolog.

            monolog Examples and Code Snippets

            No Code Snippets are available at this moment for monolog.

            Community Discussions


            Why is Composer installing an old version when it isn't specified?
            Asked 2022-Mar-25 at 15:45

            When I do:



            Answered 2022-Mar-25 at 15:45

            Since you're using PHP 8, 4.3 is the latest version of deployer/deployer that composer has determined to be compatible with your PHP version and minimum stability requirement.

            • v7 has no stable release yet, but it is the version you need to use with PHP 8.
              You can use the release candidate with composer require deployer/deployer:^7.0@RC, or if you set "minimum-stability": "RC" in your composer.json, then composer require deployer/deployer should install it.

            • v6 requires "php": "^7.2".
              I believe this is equivalent to >=7.2 <8.0.0, according to the composer manual.

            • v5 requires "php": "~7.0" (meaning >=7.0 <8.0)

            • v4 requires "php": ">=5.6.0" (meaning anything above 5.6.0)
              This old version is the one you're getting because it's the only version composer can attempt to install due to the constraints I mentioned above. I don't know if it really is compatible with PHP 8, but I doubt it.



            sh: symfony-cmd: command not found
            Asked 2022-Mar-24 at 09:09

            I have downgraded a Symfony 5.2 app template to use Symfony 4.4 in order to allow the use of some libraries that require an older version of Symfony. The problem is that when I do composer install, I get this error near the end of the installation:

            sh: symfony-cmd: command not found

            It seems that the installations are mostly successful, as my vendor folder is created and populated. But I'm worried about the error.

            What does this error mean? How do I fix it?


            Edit: Here's my composer.json file:



            Answered 2021-Aug-29 at 15:16

            symfony-cmd is a part of Symfony Flex. Your composer.json does not contain any requirement for Flex, so running composer require symfony/flex might resolve that problem.



            Lumen Passport return 500 except successfully log in request
            Asked 2022-Feb-13 at 22:33

            I've created Lumen Passport in my local and free Heroku and successfully created it. Now I’m creating my production lumen in digital ocean VPS. All of my applications work fine and give good bad responses format when it should be failed responses, except my login. In my login, it passes a good response when correct emails and passwords but returns 500 in other cases.

            This is my code in my LoginService.php



            Answered 2022-Feb-13 at 22:33

            After some time searching for answer, the problem was because my storage folder had root user permission. And it solved by giving the user and group permission to www-data with command like this



            Upgrading to Symfony 6 from 5.3
            Asked 2022-Feb-10 at 21:40

            I updated my composer.json file to reflect the 6.0.* changes, and ran my composer update "symfony/*" code, and it returned this:



            Answered 2022-Feb-10 at 21:35

            That composer.json file is a bit of a mess. Some Symfony packages on 5.3, some even on 5.1, and many on 6.

            Also you are controlling Symfony versioning from extra.symfony.require, and at the same time from the discrete version constraints. You include some packages that no longer exist on 6.0 (symfony/security-guard), and are missing some that should be installed on a 6.0 version.

            It's simply not on an installable state.

            I've managed to make it installable changing it like this:



            Laravel Monolog LineFormatter datetime pattern
            Asked 2022-Jan-28 at 16:10

            I am trying to create custom log in laravel and i am using monlog\LineFormatter class to formatt my final log



            Answered 2022-Jan-28 at 16:10

            So I got the solution for this the simplest way to do this is as follow



            Show container deprecation log in human-readable format?
            Asked 2021-Dec-07 at 16:33

            I have a Symfony 5.3 application. When the container is compiled, the following file appears:


            In contains a serialized list of deprecation messages:



            Answered 2021-Dec-07 at 16:33

            The file you are seeing is not the deprecation log, but a serialized output that the Symfony Profiler will use to show this information on dev.

            Notice that sits on the cache/build directory (var/cache), and not on the log directory (var/log).

            To configure Monolog to log deprecations, use the directions you'll find here, for example. You'll notice that the resulting log ends up where you point it to, and the result will be a regular log file in mostly readable format.



            Symfony 4.4 - Swift Mailer installation failed
            Asked 2021-Dec-02 at 14:25

            I'm a beginner in Symfony and would like to know how to deal with the following installation issue: I'm using Symfony 4.4 and trying to install Swift Mailer. Following the documentation on this link, when I ran the following command composer require symfony/swiftmailer-bundle , I got this error message:

            Your requirements could not be resolved to an installable set of packages.

            Problem 1

            • symfony/web-server-bundle is locked to version v4.4.0 and an update of this package was not requested.
            • symfony/web-server-bundle v4.4.0 requires php ^7.1.3 -> your php version (8.0.12) does not satisfy that requirement.

            Problem 2

            • laminas/laminas-code 3.4.1 requires php ^7.1 -> your php version (8.0.12) does not satisfy that requirement.
            • symfony/proxy-manager-bridge v4.4.34 requires friendsofphp/proxy-manager-lts ^1.0.2 -> satisfiable by friendsofphp/proxy-manager-lts[v1.0.5].
            • friendsofphp/proxy-manager-lts v1.0.5 requires laminas/laminas-code ~3.4.1|^4.0 -> satisfiable by laminas/laminas-code[3.4.1].
            • symfony/proxy-manager-bridge is locked to version v4.4.34 and an update of this package was not requested.

            Any idea how to handle that?


            This is my composer.json file:



            Answered 2021-Dec-02 at 14:25

            Try changing composer.json




            unable to use Hash::make('plain-text') in Illuminate\Support\Facades\Hash
            Asked 2021-Nov-30 at 22:13

            I am using Eloquent for database calls with slim framework here is my composer.json



            Answered 2021-Nov-30 at 22:13

            Here is a working example.

            First, you need to install:



            Performance when shipping logs from PHP to AWS ElasticSearch/OpenSearch
            Asked 2021-Nov-08 at 03:53

            Is it recommended to ship logs directly from a PHP app to ElasticSearch? Or is it always better to store to file and use filebeat to ship the logs? I'm familiar with C# and Serilog implementation sending directly to ES and we've never had an issue with it, but was wondering if the same could be done with a PHP app using Monolog without performance being severely impacted. I'm assuming Serilog is able to asynchronously send the logs, I'm not sure if the Monolog implementation on PHP is able to do that or if it would only be OK to ship directly as long as they're infrequent error logs but info/debug logging would cripple performance. Anybody have any experience doing this? For additional background, we'd be using AWS OpenSearch and the PHP app would also be running at AWS in ECS/Fargate containers, so it would be inside the same network.



            Answered 2021-Nov-08 at 03:53

            personally I would recommend logging to a file and then shipping, no matter the end datastore you end up chosing

            the reason is that otherwise you need to handle a tonne of logic in your client - load balancing/failover, retries, error handling, back pressure - and while another client library for that datastore may abstract some of this out, it's probably not the best place for it

            the biggest issue there would be back pressure. what happens if something happens that delays, or stops, logging to your datastore? do you keep the log in memory and retry later? do you block till the log is stored? how do you manage those aspects

            if you log to a file (or even stdout for containers) you have a pretty clear delineation point for your code. you will likely have a backup of the log incase you ever need to check it, and you can use task specific tooling to ship your logs



            Make Laravel 6.x/Monolog output stack trace of previous exceptions
            Asked 2021-Oct-22 at 08:47

            Laravel console exception output uses nunomaduro/collision package, which seems to merge the exception and all chained exception stack traces into one incredibly useful output.

            Laravel log output however uses Monolog, which doesn't appear to do this by default, and only appears to output the stack trace of the last exception thrown. It will output the messages of the previous exceptions, but not the stack traces.

            When using an exception methodology which catches an exception, creates a new exception adding more contextual information and attaching the previous one to it, creating a chain of exceptions. Having the stack trace of only the last exception thrown isn't particularly useful.

            The first exception thrown (last one in the chain) is the original cause of the error, all of the other exceptions are simply adding context/information to it.

            Is there a way to get Laravel to merge the stack traces of each exception in the chain?

            Failing that, is there a way to just get Laravel/Monolog to output the stack trace of the first exception thrown (the last one in the chain), instead of the last exception thrown (the first one in the chain)?

            (Very contrived) code example:



            Answered 2021-Oct-22 at 08:47

            After digging a bit deeper, this is an issue with Monolog 1.x in the LineFormatter only. The other formatters work.

            Monolog 2.x has resolved this issue with in the LineFormatter by this pull request:

            The solution is to upgrade to monolog 2.x (which is supported by Laravel 6.x).

            An alternative solution, should you have packages which depend on Monolog 1.x would be to use a different formatter or write your own Monolog Formatter which extends LineFormatter, and use that in your Laravel logging config.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install monolog

            Install the latest version with.


            Usage InstructionsHandlers, Formatters and ProcessorsUtility ClassesExtending MonologLog Record Structure
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone Seldaek/monolog

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link