The default logger instance sets sys.stdout to be the same as the error log, which is sys.stderr by default. If you catch "2" in a file with "2>log", and you are using the default logger on your publisher, then I think the output of all print statements (executed after the publisher is created) will go to the file.