This is a bit harder than it looks on the surface because stagit just writes the rows of the table the files are presented to it. To order them, they would have to be collected into an array, which is then sorted, and then fed into the writelog function.