Logging on demand on separated thread