In log4net I can add a custom property to the thread context like this:
ThreadContext.Properties["UserName"] = Thread.CurrentPrincipal.Identity.Name;
I can then customize the format string to output this property in the log like this:
"%property{UserName}"
What would the equivalent of this be in the python logging framework?