Fixed an issue where a worker would not always shut down correctly when it failed to check in with the database.
To avoid memory overloads, changed how we generate logs