I ran into the same problem when I was scripting
my index page. Take a look at the query that you use to pull those log entries. There should be a line almost at the end of the query that starts with the word
ORDER. Change that entire line to this:
ORDER BY t1.B_Posted DESC
That will order the results of the query from the first main post to the last main post (replies won't change the order). You probably have this, or something like it, in your query now:
ORDER BY t1.B_Last_Post DESC
and every time someone replies to the first post in a thread your log gets out of order...