You can use neologger library, it gives you the customisation you need.
You can find the detailed examples here: NeoLogger: A Developer’s Solution to Effortless, Beautiful Logging for Python Apps
Also, the pip project's homepage: neologger
Hope it helps.