Refactor and test the log folder

This follows the lines of #240 and #233 where actions were extracted from the view in order to make them testable, this time with the logs folder.