[BUG]: writing multiple documents

When writing multiple log files with the same writer we can run into
the problem of only writing the same log file: `wrier.root`. To avoid
this we can simply refer to the log file as shown in the code.