Thanks for the suggestions. In the end, I moved away from the idea of configuring my own logging, and instead just used print statements and fetch the logs from Cloudwatch right before the function exits.
print