How can the logs be set to json format in monolog....
$logger = new StreamHandler(__DIR__.'/my_app.log');
$logger->setFormatter( new JsonFormatter() );
$logger->pushHandler($logger);
This doesn't seems to be correct as it shows error
Call to undefined method Monolog\Logger::setFormatter()
also I would like my log to be recorded like this:
message{
a="something";
b="something else"
}
instead of:
message{a="something";b="something else"}
In case some other person has this question also: The formatter can be set to the handler, not the logger.
The documentation itself is not the best, but a start as well.