Issue #5214: Add checking the file and moving log text

Add checking the file and moving log text