We're going to go where
Everyone knows Mr. Spock is the king of logic. Logic can be cold and unfeeling, but for the writer logic can be your best friend especially as you're creating characters.
Creating believable characters is grounded in doing your homework. You must create your characters biographies, know them inside and out (from what toothpaste they use, what clothes they wear and even their political leanings), and give them context. So like Mr. Spock, your characters will act logically within the parameters you've set.
HOWEVER sometimes the most interesting characters are illogical. What causes illogical action? I believe the culprit is emotion and its many forms.
I'm going to refer to another logical Star Trek character . . .
Mr. Data. He was a robot, but he was constantly perplexed by humans and tried his best to understand the sometimes illogical actions of those around him. I remember the story when he was given emotions and he suddenly understood jokes, fell in love, and felt jealousy. All at once he understood illogical/logical humans around him a bit more.
Even though emotions may make your character act illogically, you still have to layer his motivation with logic. Yes, it's a vicious circle in which logic must ground illogical actions. But this is something I believe even Mr. Spock came to appreciate.
Every once in a while Spock would have a moment when he stepped out of character and would do something totally illogical, but always for a good (logical) reason. And those moments were priceless.
So I guess what I'm trying to say is your characters need to have sound logic in their motivations, but if illogical actions are called for make certain you've laid the a logical foundation for those actions. Sounds contradictory, but it really isn't.
Share with me a character that you have read or seen in the movies or on TV that was very logical, but all of a sudden did something very illogical.