Questions tagged [monolog]

Monolog is a logging library for PHP 5.3 used by Symfony2. It is inspired by the Python LogBook library.

514 questions
8
votes
2 answers

Symfony 3 and MonologBundle - DebugHandlerPass vs AddDebugLogProcessorPass

I've found this PHP message in the symfony log : php.INFO: The Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\DebugHandlerPass class is deprecated since version 2.12 and will be removed in 3.0. Use AddDebugLogProcessorPass in…
mc62
  • 329
  • 1
  • 7
8
votes
2 answers

Laravel 5 log data to another file

Is there any way to log data into another file in laravel 5? Not to standard one? For examle i'd like to use something like this: Log::info("Some log data", '/path/to/custom/file.log'); Or at least is there a possibility to divide log files basing…
el valuta
  • 287
  • 2
  • 5
  • 14
8
votes
1 answer

Monolog: log different channels and multiple handlers to grouped log file + dedicated log files

I'm facing some problems with configuring Monolog to handle "nested loggers". What I want to do: Log from services to dedicated files (one per service) AND from all services to one file. Each logger should be also handled by…
Wirone
  • 3,304
  • 1
  • 29
  • 48
8
votes
3 answers

Monolog, how to log PHP array into console?

I am using the browser handler to log message into JS console require_once 'vendor/autoload.php'; use Monolog\Logger; use Monolog\Handler\BrowserConsoleHandler; $log = new Logger('name'); $log->pushHandler(new BrowserConsoleHandler); $data =…
Ryan
  • 10,041
  • 27
  • 91
  • 156
8
votes
3 answers

How to add data to all log records in Laravel?

I would like to add some data to all log records within my Laravel application. I think it would be helpful to know the username of the current user and/or the client IP address. Currently I'm adding it manually by doing: Log::info('Pre-paid…
Rubens Mariuzzo
  • 28,358
  • 27
  • 121
  • 148
8
votes
1 answer

What is the correct configuration for Monolog / Swiftmailer Html Formatter in Symonfy2?

I'm having trouble setting up Monolog to use Swiftmailer and the Html formatter. I have multiple monolog handlers and swiftmail mailers which might be the issue. Here's my config.yml Monolog section: services: monolog.formatter.html: …
Leevi Graham
  • 654
  • 8
  • 19
8
votes
2 answers

Monolog FingersCrossedHandler

I am looking into using monolog in an application I am working on but I am unsure whether I would be able to implement what I require using the FingersCrosedHandler. I would like to only log DEBUG level messages if a message with a level of ERROR or…
John White
  • 108
  • 1
  • 5
8
votes
6 answers

Symfony2/Monolog: Log Level - only show app.INFO?

I am using Symfony2 and monolog to write in specific logs in a defined logfile (mylogfile.log): #config_dev.yml monolog: handlers: main: type: stream path: %kernel.logs_dir%/%kernel.environment%.log …
Mike
  • 2,686
  • 7
  • 44
  • 61
7
votes
1 answer

monolog sending old logs

W have web-app, built with symfony-flex. For deployment, I am using capistrano. For logging critical logs, I have configured monolog in this way: monolog: handlers: main: type: fingers_crossed action_level:…
kRicha
  • 797
  • 9
  • 27
7
votes
1 answer

PHP Monolog logger RotatingFileHandler never rotates files

PHP 7.1, ubuntu 12.04 LTS, monolog version is 1.23.0. Logger initialisation: pushHandler( new RotatingFileHandler( Main\Application::getDocumentRoot() .…
userlond
  • 3,632
  • 2
  • 36
  • 53
7
votes
1 answer

Symfony production logs

In Symfony 3 is there anyway i can write all errors to logs on production without setting the debug mode on? Errors would include http 500 errors or application errors or the php errors which are silenced due to the error flag set to false on…
7
votes
2 answers

Monolog: Handler to catch errors/exceptions and output the messages in the response (as per PHP default)

How can I configure Monolog to output PHP errors within the response, as would have been done without Monolog? What I want to do is when, for example, a PHP E_ERROR occurs within a PHP page, that error message will be output to the response, and…
Jodes
  • 14,118
  • 26
  • 97
  • 156
7
votes
2 answers

MonologBundle memory leak (?)

I have a long running process in Symfony2 (rabbit consumer) and I am using the MonologBundle for logging. The lines are logged immediately but I have noticed that the memory consumption of the process is increasing with every iteration, reaching…
Tibor
  • 651
  • 1
  • 8
  • 18
6
votes
0 answers

Exclude log entries based on channel and level from Symfony logging

My Current configuration: monolog: handlers: target_main: type: fingers_crossed action_level: debug handler: file_log channels: ['!security' '!request'] file_log: …
Mindau
  • 61
  • 1
6
votes
1 answer

Adding labels to GCP log entries from GAE

Currently I'm using Symfony 4 on the Google App Engine Flex environment. I'm trying to add extra 'labels' to my log entries to help with debugging, I've been using a Stackdriver handler to log events, and I tried adding the new labels to the…
1 2
3
34 35