JSON logging

We’re are setting up a loki/Grafana environment for our Mayan EDMS system and therefore we would like to have the application logs formatted to JSON. I’ve looked at how this can be done with a standard Django Application but we are having some difficulty getting it to work for Mayan. Does anyone have any experience or tips on how to format the logs to JSON?

thanks in advance, cheers