The last posted code contains:
inside an if test:
if (beeCounterA != lastBeeCounterA)
It's hard to tell whether you have a similar prevBeeCounterB, or not. You would need one.
The variable names used in this application are terrible. I look at a name like buttonBeeCounterA and I think of a pin that a switch is connected to. I can't imagine why writing a pin number to the output file is of any interest.
I think that the best thing, at this point, is for you to post all of your code.
Changing the whether to log code is easy:
if (beeCounterA != lastBeeCounterA || beeCoutnerB != lastBeeCounterB)
In the code to actually log data:
if(beeCounterA != lastBeeCounterA)
if(beeCoutnerB != lastBeeCounterB)
But, like I said, I can't tell that the correct stuff is being tested, or that the correct stiff is being written to the file, since the names are horrible.