I have generatereport.py custom search commands that tends to fail on Logger registration.
I have checked log files and found in generatereport.py.log that issue is probably in logger registration as Logger setup message runs multiple times and my logger.info() that is on start of def reduce(self, records) is not logged.
Unfortunately, this is random. Sometimes I get logger registration message logged a few times and it fails with error (post img) and sometimes I get registration message a few times and then it continues with the script as it should.
Example of log is on the bottom of this post.
This is how I start logging, taken from answers.splunk.com