Normally, in SBC running RTOS, it would be an easy task to write data/event logs onto an external media such as SD cards. However, in embedded systems that uses microcontroller, e.g. PIC microchips, have limited data/program memory. Although some chipset have the support for external media, assumming that it doesn't, how would one log in MCU?
The only plausible way that I could think of is to write it to MCU's EEPROM, but is this feasible? If this could be done, how would one write and read?
Logging can be performed to any memory device, SD cards included (assuming the relevant hardware peripheral is available). If there is an external device attached over a serial port, you can write data to it.
Commonly, event logging is done in exceptional cases only. Writing to EEPROM or Flash (for newer devices) is relatively slow, consumes power, and uses up a finite resource (space, and erase cycles).
For debugging, using a serial port (or the SWO port on Cortex-M3) is common.