Score:2

Alter jsonlog data

jp flag

I am looking to alter the generated output of the log files from the contrib module JsonLog - https://www.drupal.org/project/jsonlog/ The logger generates a .log file, which I need to customize with a few additional fields. Is there a way to alter the data generated by the Logger class? What is the best approach for this? Is extending the Logger within a custom module a good approach?

Score:3
ru flag

Loggers in Drupal are Symfony services, so the best way to modify this is to decorate the logger.jsonlog service (you need a custom module to this of course). I'd suggest starting with the Symfony docs or google'ing for symfony decorate service to get some code examples.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.