Logging and sleeping