I know, but it was so ridiculous. HOW did Martha know that Logan had the recording device on his body? It seemed she found out Jack couldn't get the confession at the same time Mike Novack did. It made no sense.
Two thoughts: She may not have know, and just flipped out anyway. She knew Jack had failed so she lost it. Second, Jack always has a back up plan. I'm sure he knew he probably couldn't kill Logan, so he brought the pen with a listening device, and then did the ol' switcheroo on Logan during the confession scene. Now I can't recall the exact trail of said pen (I wonder if Novick gave it to him?), but het, it's 24! And with Jack on the slow boat to China, we have no idea if he really had any part in it at all.
Logan got the upper hand though by giving Jack to the Chinese.