Java, multiple threads, log