ESP8266 collect internal logs into littleFS

Is it possible to collect internal logs from ESP8266 into littleFS? I have found solution for esp-32, but it doesn't work for esp8266. Is it possible to output LOGS to a SPIFFS file that's inside the ESP32? - #5 by GeorgeFlorian - PlatformIO Community. Maybe exist some approach how to force existing Serial.prntln("Some data") push data into the file on using LittleFS?

I have found solution for esp-32, but it doesn’t work for esp8266

What exactly “doesn’t work” ?

Have you tried the examples from https://github.com/esp8266/Arduino/tree/master/libraries/LittleFS

Esp8266 doesn't allow to do this esp_log_set_vprintf(&vprintf_into_spiffs);
'esp_log_set_vprintf' was not declared in this scope
I need a way to tell Serial.println tell Seria.println redirect output to file.
For example when start web server it sends to cosole debug messages. I need to redirect messages to file. Solution should force use custom logic when Serial.prinln was triggered. It allows me to see internal logs esp or libraries.