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

Undefined function within Monologger\Logger class (addCritical function)

I'm following this monolog tutorial and the example with trying to send a critical log via email using Swift. monolog+swift_tutorial i've copied the code exactly, which is located under heading Handler order in the tutorial link. I've changed the…
digitalXmage
  • 23
  • 1
  • 7
0
votes
1 answer

Problem monolog doctrine channel logging, symfony 4, with php

im have problem in monolog doctrine logging (in symfony 5): framework.yaml: monolog: channels: [doctrine_channel] handlers: main: channels: ["!event", "!doctrine_channel"] doctrine: type: service …
prem111
  • 63
  • 1
  • 7
0
votes
1 answer

Slim 4 monolog does not write logs

I configured monolog in my slim 4 application and set logErrors and logErrorDetails to true in ErrorMIddleware but when I got an error it does not write logs. To emulate error I turn on the cache on my app and I'm getting an error like this Call to…
Bogdan Dubyk
  • 4,756
  • 7
  • 30
  • 67
0
votes
1 answer

symfony4.4 use monolog mailer occurs error [ Maximum function nesting level of '256' reached, aborting ]

I refer to the doc of [How to Configure Monolog to Email Errors] (symfony version 4.4) docs link Occurs error: Maximum function nesting level of '256' reached !! Error {#5035 !! #message: "Maximum function nesting level of '256' reached, …
0
votes
1 answer

Grokking context of PHP monolog message into ELK

I want to be able to search in Kibana on the fields that I log as context in Monolog. I mean that if I $log->info("Request", $visitDetails); where $visitDetails is an array then I'd like for Logstash to grok this for Elastic so that the array…
Andy
  • 2,095
  • 1
  • 29
  • 59
0
votes
1 answer

monolog catch Fatal Error: Allowed memory size exhausted

I would like to know how I can make monolog for symfony 4 logging fatal errors: PHP Fatal error: Allowed memory size of xxxx exhausted to the main log handler. In my application these errors are logged in the PHP error_log file.
Sebastian Viereck
  • 5,455
  • 53
  • 53
0
votes
2 answers

lumen-logging with dynamic path at run time

I have used this function in bootstrap/app.php file $app->configureMonologUsing(function ($monolog) { $maxFiles = 7; $rotatingLogHandler = (new Monolog\Handler\RotatingFileHandler(storage_path('logs/lumen.log'), $maxFiles)) ->setFormatter(new…
hetal gohel
  • 335
  • 9
  • 21
0
votes
1 answer

Monolog handler ignoring yaml level

In Symfony 4.3 using Monolog, I have created a custom handler to push logs to AWS Firehose. Here is the constructor: class FirehoseLogHandler extends AbstractProcessingHandler { public function __construct( FirehoseClient $firehoseClient, …
Wildcard27
  • 1,437
  • 18
  • 48
0
votes
0 answers

Symfony 4 custom logger with multiple channel

I want to make one Logger class which can be use in different modules in Symfony and when logging to have different channels. Here is my configurations: service.yaml App\Logger\MLogger: arguments: ['@logger'] tags: - { name:…
0
votes
0 answers

How to set different error levels in Symfony logging

The Symfony documentation on "How to Configure Monolog to Email Errors" is describing how to combine two different logging targets (last example, scroll to bottom of doc). # config/packages/prod/monolog.yaml monolog: handlers: main: …
Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116
0
votes
1 answer

Can I add a Processor to just one Monolog handler?

Can I add a Processor to just one Monolog handler? Or is there some other way I can alter a message that is only going out to one particular handler? I want to add a text string to the end of $record['message']. I can do this now with a processor,…
Eric
  • 5,104
  • 10
  • 41
  • 70
0
votes
1 answer

Why in "docker logs" i can`t get my logs from monolog?

in docker logs i see only nginx messages, but not from monolog https://i.stack.imgur.com/1iRjV.png I tried send some message to stdout stream and see it in docker logs $logger = new \Monolog\Logger('MyTestName'); $handler = new…
scloud
  • 1
0
votes
4 answers

How to use a global constant instead of a class constant in PHP version 5.6

I'm using Monolog to create my app's logging system. In the core app file, after I create a new Monolog object, I need to select the log level that I want to print in the log file. I want to use a global constant LOG_LEVEL which could be 'DEBUG',…
Godryc
  • 3
  • 1
0
votes
0 answers

Code only to be ran if the page is accessed by user

This is the code for my 404.php:
Daniel L
  • 123
  • 8
0
votes
1 answer

collect and format logs from stdout(php - monolog) in node js with exec

my PHP call from node.js is : const process = exec('php ' + phpScriptPath, (err, phpResponse, stderr) => { if (err){ this.logger.error('failed:' , err); } }); process.stdout.on('data',…
Tuz
  • 1,810
  • 5
  • 29
  • 58