I totally agree with DanTheMan. You are right. It is anti social griefers and trolls who are the ones who excuse their behavior by calling it legit, and telling decent players to get out of the game. Being attacked by NPC ships is, obviously, not griefing, but the situation you described is definitely griefing and trolling.
However ... combat logging is considered cheating by most, hence the reason for the 15 second logout delay when in danger. That is a shame since combat logging is only really useful when being griefed and trolled by anti social players whose goal is to ruin your gameplay, and who excuse their actions by aggressively complaining that it is legit and that decent players get out.
All in all, when being trolled and griefed (and regardless of the innuendo that anti social griefers throw around), it may seem the only option to prevent others destroying your enjoyment of this fantastic game, even though it is usually considered against the rules. However, as NPCs are not griefers, it is definitely not right when being attacked under those circumstances.
And (and I don't care if I get called out for starting a sentence with the word 'and'), when you have a bounty on your head, one is fair game to others, so combat logging then I would say is also not on.