Monolog is a logging library for PHP 5.3 used by Symfony2. It is inspired by the Python LogBook library.
Questions tagged [monolog]
514 questions
0
votes
1 answer
Magento - Wrong log file path
I was fixing an issue in Magento and I found a suggestion to run
composer update
and
setup:upgrade
After this I fell in an error for wrong log file path:
/var/www/html//var/log/system.log
I found this error in var/log/exception.log
The stream…

AbdulKarim
- 605
- 5
- 18
0
votes
1 answer
Composer throws PHP Fatal error: Interface 'Monolog\ResettableInterface' not found when deploying
So here's my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"laravel/framework": "5.1.*",
…

Mitch
- 107
- 1
- 2
- 9
0
votes
1 answer
Symfony3.4 monolog bundle not writing to custom channel file
When i add a custom channel in monolog the file not creating and not logging in to file.
my config_dev.yml
debugchannel:
level: debug
type: stream
path: "%kernel.logs_dir%/debug_%kernel.environment%.log"
…

Divyasree MP
- 55
- 7
0
votes
1 answer
Symfony4. To use monolog or not to use?
I need for my project a logger to log some events, like sending of confirmation e-mails, transitions in the workflow etc. It's not about what happens in the doctrine, form etc (dev.log)
Is the using of monolog the right way for my issue?

olek07
- 513
- 2
- 7
- 21
0
votes
3 answers
Save monolog in mongodb in symfony 4
I want to add monolog in mongodb with default handler(MongoDBHandler) in Symfony 4.
my monolog.yaml file in dev folder
monolog:
handlers:
mongo:
type: mongo
mongo:
id: monolog.logger.mongo
…

ShahRokh
- 1,005
- 14
- 31
0
votes
1 answer
monolog slackhandler and base file handler don't work together
I tried so much.
$monolog = Log::getLogger();
$slackHandler = new \Monolog\Handler\SlackHandler(env("LOG_SLACK_WEBHOOK_URL"), 'translive', null, true, null, \Monolog\Logger::INFO, true, false ,false);
…

Nika Kurashvili
- 6,006
- 8
- 57
- 123
0
votes
1 answer
How do I get the time from Monolog message?
I added Monolog v.1.24.0 to my project.
Create a logger:
$logger = new Logger('db');
$logger->setTimezone(DateTime::getTimezone());
$logger->pushHandler(new StreamHandler(ROOT.'/log/db.log', Logger::DEBUG, 600));
Now at some point later in the…

centurian
- 1,168
- 13
- 25
0
votes
1 answer
Possible to configure per-bundle logging config in Symfony
I am trying to manage logs configs on a per-bundle basis within symfony (3.4).
In more detail, I am working with an application with many bundles and want to make logs easier to identify. The best way that I have found to do this so far is to…

Wildcard27
- 1,437
- 18
- 48
0
votes
1 answer
Monolog implementation in singleton
I'm attempting to use monolog in an application that contains a startup page, a Configuration class called by startup, and a lot of MVC type classes. Trying to figure out a way to make logging easily accessible. (I read this, which was helpful, and…

John Springer
- 49
- 7
0
votes
1 answer
Laravel log, how to retrieve the level?
How can I retrieve the log level in Laravel?
I'd like to do something like this:
if ( Log::isInfo() ) {
...
}
for instance, in log4java, you have the methods isDebug, isInfo, etc.
In the example, the idea is that isInfo tests if a message in…

Daniel Francesch
- 21
- 4
0
votes
1 answer
Symfony - monolog specific handler
I am building a e-commerce application under symfony 4.0.
The application is getting complex and I want to log the process.
I would like to log it in a specific log file.
For that I have create a new monolog handler :
monolog.yaml :
monolog:
…

123pierre
- 305
- 1
- 4
- 18
0
votes
1 answer
Symfony custom log handler service call
I have created custom log handler in symfony. Creating it was not a problem, config: config/packages/dev/monolog.yaml
monolog:
handlers:
....
alerts:
type: service
id: App\Logger\AlertLogger
…

Lucas
- 47
- 2
- 10
0
votes
1 answer
Symfony monolog syslog formatter
Is it possible to format the log for syslog? The config.yml configuring syslog:
monolog:
channels: ['auth']
handlers:
auth:
type: syslog
level: debug
facility: local0
channels: [auth]
The resulting…

paddel10
- 170
- 1
- 12
0
votes
1 answer
Symfony 3.4 - Differentiate logger based on "context"
I'd like to be able to differentiate the channel used by Monolog based on if a service is called by a Symfony command or by the application server.
For example:
class A {
private $logger;
public function __construct(LoggerInterface $logger)…

Dario Vogogna
- 618
- 6
- 7
0
votes
1 answer
Logstash and nested JSON from Monlog; Why arrays are converted to JSON string?
I am using PHP with Monolog. I am outputting logs to JSON file and using Gelf to Logstash which then sends logs to ElasticSearch.
The problem I have is that I am missing the extra object in Kibana and the tags field gets interpreted as string…

Tom Raganowicz
- 2,169
- 5
- 27
- 41