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
0
votes
1 answer

symfony 5.3 logfile could not be opened in append mode: Failed to open stream (docker)

I have a rotating Logfile configured with monolog, which worked like a charm and suddenly I get error messages stating that the file cannot be created, when the frontend is calling my symfony backend, which runs in a alpine docker…
Calamity Jane
  • 2,189
  • 5
  • 36
  • 68
0
votes
1 answer

How to use NotifierHandler with monolog in Symfony 5.4

i can't use this handler in monolog configuration : https://github.com/symfony/symfony/blob/5.4/src/Symfony/Bridge/Monolog/Handler/NotifierHandler.php monolog: handlers: discord: type: notifier action_level: error this is the…
Thomas
  • 1
  • 1
0
votes
1 answer

How do I control Drupal 8 monolog dblog log-levels

I'm using Drupal 8 with the Monolog module (1.3) for external log support and Sentry logging, while preserving core database logging (dblog/watchdog). This all works, except that I can't find a way to control the watchdog logging level (so I'm…
bfuzze
  • 438
  • 8
  • 15
0
votes
1 answer

How to use monolog ElasticSearchHandler for logging in a Laravel application

Monolog contains elastic search handler and formatter, but it's implementation to laravel as a custom channel is not as straightforward as described on Laravel documentation web site.
Max Shaian
  • 418
  • 4
  • 11
0
votes
0 answers

Using a monolog logger within the Slim microframework, there are no errors being output however no log files are being created or written to

I have used Monologing before and not had a problem however with this application no log files are being created even though I have monolog warnings and notices throughout the application but nothing has been created, It might also be worth noting…
Brokili
  • 23
  • 7
0
votes
2 answers

Monolog MongoDBHandler having BindingResolutionException error in Laravel 8

I tried to create a mongodb logging channel 'mongo' => [ 'driver' => 'monolog', 'handler' => \Monolog\Handler\MongoDBHandler::class, 'formatter' => \Monolog\Formatter\MongoDBFormatter::class, 'handler_with' => [ 'mongo' =>…
Laval Boi
  • 21
  • 5
0
votes
1 answer

Is Monolog safe for logging to same file from multiple scripts?

Will using Monolog remove the potential bottleneck as compared to logging with file_put_contents with LOCK_EX flag? I have the following public-facing PHP script, which gets executed about 10x/s on average, and 100x/s in peak times. This resulted in…
c0dehunter
  • 6,412
  • 16
  • 77
  • 139
0
votes
3 answers

Saving command logger output to log file and console

I wrote a very simple test command which has LoggerInterface injected in its constructor. How am I suppose to change the monolog.yaml configuration to save this logger output to both log file and to output it to console? monolog: handlers: …
sebastian_t
  • 2,241
  • 6
  • 23
  • 39
0
votes
2 answers

Symfony/Monolog: Log into database --> Serialization Error

Background I want to save symfony / monolog Logs into my database. I followed this guide which is acutally giving a good solution. Problem My solution is working in general, but I get errors (Serialization of 'Closure' is not allowed) while trying…
Tim K.
  • 335
  • 4
  • 23
0
votes
1 answer

Monolog does not accept critical error in Crunz callback

I'm using Crunz to trigger a task. In this task, I'm successfully logging info. When trying to log a critical error in the callback function, I get an error. The log mentions: [2020-09-16T11:36:24.050666+00:00] MyLogger.CRITICAL: Critical error has…
GlennM
  • 300
  • 1
  • 14
0
votes
1 answer

Monolog has no permission to write on OSX

I'm using the built-in php server to setup a server for my slim project, using php -S localhost:8000 Now I've included Monolog with the default config. Whenver I try to write using Monolog I get the following error There is no existing directory at…
Miguel Stevens
  • 8,631
  • 18
  • 66
  • 125
0
votes
0 answers

Stackdriver multi-channel logging with Symfony/Monolog and Google Kubernetes Engine

is there a current method to do some multi-channel logging of an Symfony application running on Kubernetes in Google Cloud and having the log channel data collected in Googles Stackdriver? I've found an older solution under Google Cloud Stackdriver…
Dennis G.
  • 11
  • 3
0
votes
0 answers

Symfony logs not visible in the Symfony profile

I need help. I am using Monolog logger. use Monolog\Logger; $logger = new Logger('app'); $logger->pushHandler(new StreamHandler(\dirname(__DIR__, 2) . '\\var/log/dev.log', Logger::DEBUG)); $logger->pushHandler(new…
Pr9nik
  • 1
  • 1
0
votes
0 answers

Laravel / monolog processor merge json

I have followed instructions to use a monolog processor to add meta data to a log entry like so: class CustomizeFormatter { public function __invoke($logger) { foreach ($logger->getHandlers() as $handler) { …
user1978109
  • 727
  • 1
  • 8
  • 19
0
votes
2 answers

Force slack logging into queue

I have a bit of a dilemma as I need to come up with a good logger that logs what is happening in the app at the same time if there is a Log::error called, it should also notify Devs and Sys admin via slack. It is currently working, but it adds an…
rfpdl
  • 956
  • 1
  • 11
  • 35