The logfile.print() command writes values to a buffer and not the actual sd card. The physical write is by a file.close() or a file.flush() command, or by the workings of the SD.h library itself when the buffer is full and holds 512 bytes.
If you rely on the library to write to the card, you can loose data if you don't close the file at the end of your sketch.
Did you let the program run long enough for the buffer to fill and have the SD library write the card?