When it comes to commas and periods, though, logic doesn't enter into the equation, at least not in the United States. Universal American usage places commas and periods inside the quotation marks, regardless of logic.
The only exception is when that last little item enclosed in quotation marks is just a letter or a number, in which case the period or comma will go outside the closing quotation marks:
~The buried treasure was marked on the map with a large "X".
In the US, the rules dictate that commas and periods go inside the quotation marks. In the UK, it follows logic. (Basically, this means if the comma or the period (full stop) can be attributed to the original quote, then it goes inside.) Interestingly, in the US, there is a growing number of people following the logic idea too.