There are lots of ways to do it. This tutorial demonstrates logging ticket prints and reporting them.