On Thu, Nov 11, 2021 at 5:00 PM Vijay Karavadra via Python-list <python-list@python.org> wrote: > > Hello Team, > > I'm trying to add logs in the new relic platform from a python application. > For that, I've to add logs in a local file in a specific format which is > > '{"log.level":"%(levelname)s", "log.entity.name":"my-service-name", > "message":"%(message)s"}' >
Looks like JSON to me. Have you considered using the json module to format it? json.dumps({"log.level":levelname, "log.entity.name":"my-service-name", "message":message}) ChrisA -- https://mail.python.org/mailman/listinfo/python-list