Main log funcionality.