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
0 answers

Error while installing Open Web Analytics

Getting the below error while installing Open Web Analytics. Open Web Analytics - 1.7.8 Operating System : Windows 10 Wamp Server : PHP Version 8.0.26 MySQL 8.0.31 Apache 2.4.54.2 Fatal error: Uncaught Error: Class "Monolog\Logger" not found in…
0
votes
0 answers

Laravel application hosted on GCP k8s has stopped logging errors into Cloud Logging correctly

My Laravel application hosted on GCP k8s has stopped logging errors into Cloud Logging correctly. I haven't intentionally changed anything. I'm just using the config env: - name: LOG_CHANNEL value: stderr - name: LOG_LEVEL value:…
Mr J
  • 2,655
  • 4
  • 37
  • 58
0
votes
1 answer

Passing optional custom parameter with Laravel (Monolog) logging

I have a Laravel project. I would like to pass an optional custom parameter (domain ID) when creating log entries. I am logging to a MySQL database via a custom Monolog event handler, based on this tutorial:. I have searched but cannot find any…
Mr Fett
  • 7,979
  • 5
  • 20
  • 21
0
votes
0 answers

Laravel and Monolog: Why do I get 'WARN' message on STDOUT with 'stderr' channel?

I have a question about why Monolog on Laravel shows "WARN" message on STDOUT. How can I avoid it? I'm running a new Laravel 10 project. I've created a RequestLogger middleware which executes the following line on every request, and I configured the…
Guanart
  • 1
  • 1
0
votes
0 answers

Configuring Monolog With "php://stderr" On Local Valet

I'm doing local development on a PHP project that is hosted in Heroku. I'm using Laravel Valet for my local environment, but it's not a Laravel project. Heroku recommends writing to php://stderr. When I execute this code... $logger = new…
Sonny
  • 8,204
  • 7
  • 63
  • 134
0
votes
1 answer

Symfony logging / monolog rotating_file

i'm working on an app that generate a lot of logs , I want to create for every hour a new log file , Symfony supports files names only by days Another option is to have Monolog rotate the files for you by using the rotating_file handler. This…
Badr MOUMOUD
  • 166
  • 2
  • 10
0
votes
0 answers

How to use monolog logger channel across files

Following the symfony documentation: https://symfony.com/doc/current/logging/channels_handlers.html I've created custom handlers to log console command in separate files: console-live: type: console process_psr_3_messages: false …
Baptiste
  • 1,688
  • 1
  • 15
  • 25
0
votes
0 answers

How to get Log level using Laravel Monolog and custom Class

I am in a project in which I use a custom handler to make the logs of my project. For this I use Monolog, one of the main reasons to use this is to format the message that I keep for the log. So I do something like this in the logging.php 'channels'…
0
votes
0 answers

Can't search log items in AWS CloudWatch

I have the following code that pushes to cloudwatch: $this->logger->info('Offer did not have desired reservation status', [ 'message' => 'Offer did not have desired reservation status', 'context' => 'offer_sync', 'action' =>…
Bird87 ZA
  • 2,313
  • 8
  • 36
  • 69
0
votes
0 answers

How to log PHP errors

I am developing PHP websites on my own and want to turn off displaying error messages to the browser as sites move into production. I thought about setting up Monolog but am worried that with just me developing it might be overkill and more…
user3425506
  • 1,285
  • 1
  • 16
  • 26
0
votes
0 answers

Symony 4 command: log in production

I have a Symfony command which is executed under a cron entry and I need some log in production environment. As I read here in production, for console commands, verbosity level is related to log level shown, so I tried to configure monolog to show…
K. Weber
  • 2,643
  • 5
  • 45
  • 77
0
votes
0 answers

Symfony Monolog container error once every 500 requests

Since upgrading to PHP 8.1, Symfony 6.1, Monolog 3.2, I have been seeing a PHP fatal error while constructing the Symfony DI container: 2022/12/12 04:10:02 [error] 31#31: *919 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught…
Erik Baan
  • 436
  • 6
  • 12
0
votes
0 answers

Monolog rotating log not formatted correctly

Using monolog (3.2) with rotating logs handler. Everything works fine BUT, the rotated logs don't use the log format I set. The main log is fine; the dated logs use the default output format instead. It looks like the RotatingFileHandler should…
0
votes
0 answers

Using monolog to log to a variable

I would like to use Monolog to log a single process, eg the progress of a command, and return that log when the command is finished. The process is not necessarily a console command. Is there a handler in monolog that allows me to log to a variable…
commonpike
  • 10,499
  • 4
  • 65
  • 58
0
votes
0 answers

Lumen changed log format from raw json after update

I've upgraded lumen from 5.8 to 9.1 and php from 7.x to 8.1 In my env we load json logs to kibana, but after update log format has changed to something like this: 2022-11-08 11:56:47 App\Domain\Email\Listeners\MoveEmailToProcessed{"message":"Marked…
Adrian Modliszewski
  • 1,114
  • 2
  • 18
  • 31