The log is accurate. The replays aren't. They're generated/recreated after the battle from incomplete information. You should usually trust the log.
There's been quite a few tweaks and fixes to replays in the upcoming update, so hopefully they should be more accurate in future.
It's been stated by the admins before, but let's sum up what it likely means here. What you do in battle gets stored on the server. Those actions are then relayed to the device of the person who was attacked in battle for the replay. Each device has slightly different processing capabilities, so the replay you see is likely slightly to significantly different then what actually occurred. That being said, what the results are, are what actually happened on the attackers device. So while frustrating, they won said battle fair and square by using the technique they've developed on their device to it's full potential. They may have a slight advantage or disadvantage in the long run because of the device they are using, but you can't hold that against the programmers who are still tweaking this feature and the rest of the game as a whole. As someone who has done quite a bit of coding myself, I can tell you, getting perfect variations between different machines can be nearly impossible.
Its a shame we can't trust the replays, as viewing them gives useful clues as to your bases weaknesses.
Well...yes and no. The replays seem to go wonky during the heaviest fighting. Then, a few troops deviate from there they really went, and get killed by a mortar shot, and the errors start compounding, and it's all downhill from there. You definitely can't trust the last half of the fight, or the final results, but the first part of the replay generally stays more accurate. You should be able to get a good idea of where people are deploying troops, and where/how they're breaching your defenses.