FAQ Database Discussion Community

Logs an entire array using Monolog [closed]

Is there any way to log an entire array using Monolog? I have been reading several docs but didn't find a way to log the entire array in a readable format, any advice? Docs I've read: Monolog, how to log PHP array into console? http://symfony.com/doc/current/cookbook/logging/monolog.html https://www.webfactory.de/blog/logging-with-monolog-in-symfony2 ...

How to create rotating log file with Laravel and Monlog

I'm trying to create my own rotating log file in Laravel using Monolog, however, the file rotation is not working and I don't know why. I've created an artisan command that runs once per day, and keeps a log of it's activity. I want old versions of this file to...

Write logs in symfony using Monolog

I have a problem with my project, I want to use Monolog to write the logs and I can't do. So, I created an service : services: my_logger: class: Monolog\Logger arguments: [Debug] calls: - [pushHandler, [@my_log_handler]] my_log_handler: class: Monolog\Handler\StreamHandler arguments: [/home/vagrant/Workspace/symfony/app/logs/test.log, 100] My controller : $em = $this->getDoctrine()->getManager(); $categories =...

How to create one log file per session?

I want to create for each session an own logfile. I have seen that it is possible to create an own logger (source): use Monolog\Logger; use Monolog\Handler\StreamHandler; // create a log channel $log = new Logger('name'); $log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); // add records to the log $log->addWarning('Foo'); $log->addError('Bar'); Is it possible...

How to configure Monolog to store logs into MongoDB with Symfony2 and Doctrine

Would it be possible to get a full example of how is it possible to configure Monolog to store its logs into MongoDB using Symfony 2.6 and Doctrine 2?

laravel 5 - how to create custom log levels?

I want to log user actions, app requests, etc... Something like: [2015-04-23 20:40:36] user.register {"name":"mike", "age":"35"} [2015-04-23 20:40:55] user.login {"user_id":123} All of entries should go to a separated files by action type. Can I do this using Laravel 5 Monolog library? How? Thanks!...

How to write and use Monolog handlers and channels

I have read some docs here but still not clear to me how to write and use a custom Monolog handler and channel. Let me explain a bit what I want to achieve. I have a custom function and I want that log to be logged into a file called...