implement the log mechanism