This is important in two ways, one obviously for invoicing but more than that to calculate the productivity of the developers. That's why we take time logging very seriously. We have an internal tool. called "Tyme" for measuring the time logs.
This works in sprints of 2 hours. Once started you are supposed to continue it for approximately 2 hours. At the end of two hours, the tool shows a popup saying that your sprint ended, put the description of the work you have done and commit the code with its existing status. This comment is automatically pushed onto the internal slack channel. He can take a break or whatever after every sprint. This way we make sure that every developer spends the most productive and effective 2 hours on the project.
We are also experimenting with Toggl app for logging time as it has a lot of detailed reports about the time utilization.