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

Symfony2 Monolog Settings for email and file logging

I want to setup Symfony2 to send me an email for critical errors, but just log error level errors. Will the following settings do that? monolog: handlers: main: type: fingers_crossed action_level: error …
Matt
  • 5,478
  • 9
  • 56
  • 95
5
votes
1 answer

Symfony Messenger: Send logged messenger errors per email (via swift_mailer)?

I've configured monolog to send errors via email as described in the symfony docs here: https://symfony.com/doc/4.3/logging/monolog_email.html Works well with all errors happing during a request, as well as console command errors. But it does not…
virtualize
  • 2,287
  • 2
  • 25
  • 36
5
votes
0 answers

Laravel logs are still automatically cleared despite setting log_max_files to 0

Laravel is automatically clearing the logs on our production server once every seven days. The desired outcome is to keep one log running log file that is never cleared. I have set 'log_max_files' => 0 in config/app.php. I cleared the cache with…
5
votes
2 answers

How to change Monolog channel for some controllers Symfony 3.4 or 4+

I want to change Monolog channel. My declarations works with some classes but never with controllers. Here is my new admin channel declaration: #config/packages/dev/monolog.yaml monolog: handlers: admin: type: stream …
Alexandre Tranchant
  • 4,426
  • 4
  • 43
  • 70
5
votes
2 answers

Log deprecations to own file in symfony production

I have multiple production shops with a Symfony base. Now i want to write a log file which logs all deprecations. I want them to appear in a "deprecated.log" file. These deprecations are read into kibana later. The Monolog-Readme says WARNING…
Patrick
  • 1,562
  • 1
  • 16
  • 33
5
votes
1 answer

Symfony 2 Injecting logger service

I got a strange problem using the logger service in symfony 2: When injecting the logger to a service, I get a type error because LoggerInterface expected but Symfony\Bridge\Monolog\Logger given. Also if I try to inject a custom logger, I get error…
user1827297
  • 83
  • 1
  • 3
5
votes
1 answer

Symfony log deprecated warning on new file

I want to log only the deprecated warnings to a new file. But I can't see how to achieve that with monolog. Is there a custom configuration? Thanks in advance!
5
votes
1 answer

What isn't right with logging in Symfony 3

I have configured logger for different channel in different files, but it does not work for me. It's work but it writes in console not in pointed file. And I need write log to file in channel search. Here is my…
Haygo
  • 125
  • 2
  • 12
5
votes
5 answers

How to send Log event from Laravel to Loggly?

I want to send Monolog logs from my Laravel 5.1 application to Loggly.com online log management service. From all possible environment, including local development.
Mladen Janjetovic
  • 13,844
  • 8
  • 72
  • 82
5
votes
2 answers

Response logging in AWS PHP SDK v3

In v2 of the AWS PHP SDK, I was able to setup logging of request and response information by simply doing this:
jmar
  • 452
  • 2
  • 14
5
votes
1 answer

Symfony2: __toString() must not throw an exception

I am deploying my Symfony2 application, but I am getting the following error: FatalErrorException in classes.php line 0: Error: Method Symfony\Component\HttpFoundation\Request::__toString() must not throw an exception Apache is slightly more…
xfscrypt
  • 16
  • 5
  • 28
  • 59
5
votes
1 answer

Is there a way to centrally preprocess all logs created by monolog?

I am currently working on a big application that uses monolog for logging and was asked to hide any sensitive information like passwords. What I tried to do, was extending monolog so it would automatically replace sensitive information with…
Loupax
  • 4,728
  • 6
  • 41
  • 68
5
votes
1 answer

Laravel logging with Monolog\Handler\BrowserConsoleHandler

How can Laravel 5's logging be changed to Monolog\Handler\BrowserConsoleHandler? What doesn't work in Laravel 5 but does work in a standalone PHP file: use Illuminate\Support\Facades\Log; use Monolog\Handler\BrowserConsoleHandler; use…
codelk
  • 91
  • 1
  • 9
5
votes
1 answer

Configure PHP Monolog to log to Amazon S3 via stream

We're using Monolog to log output from our server side PHP worker scripts, that execute on Amazon Elastic Beanstalk EC2 server instances. It's rather hard to access log files, especially considering that servers start up and shut down as scaling…
josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157
5
votes
2 answers

Why does Symfony still log to a dev.log file, even when I didn't define it in a loghandler?

During the execution of Symfony Commands, I want to log messages to a different file. I have read the Symfony and Monolog documentation, and it should work like I describe here. (Note that I know messages from the 'doctrine', 'event', ... channels…
Stivni
  • 437
  • 1
  • 6
  • 15