Thank you very much for the response, Nick.
If I run the above code, I get an error message showing "error opening log.txt" with blinking red LED.
Yes, I edited Sd2PinMap.h file as shown in the below and it should be okay since it is recommended by Lightblue Bean website (or, they might be wrong..).
SDA_PIN = 18
SCL_PIN = 19
SS_PIN = 2
MOSI_PIN = 3
MISO_PIN = 4
SCK_PIN = 5
Yes, I also formatted the SD card as FAT16 as other users recommend.
Lastly, yes, I think my problem is exactly what you said. Lightblue Bean+ (or, Arduino) can recognize the SD card, but it still could not write values in the .txt file.
Anyone has other tips which I could try?