improved the log extraction