How to debug WiFi connection disconnects

I get some data through the GPIOs of a ESP8266 and save
them on a mobile phone which is connected to a WLAN access point (WiFi.softAP) on the ESP8266.

The problem is, if the ESP8266 is in actual use, the WLAN connection between the
ESP8266 and the mobile phone persists only for 5 to 20 seconds.

I have already enabled WiFi debug in Arduino IDE, the problem is, you can only
send the debug output to a Serial.
But if I connect the ESP8266 through usb with a computer or a mobile phone,
there are no wlan disconnects at all.

Therefore in order to find the reason for the disconnects, it would be useful to send the debug output to a file on the ESP8266.

Could this also
be a problem if you use: while ( swSerial.available() > 0 ) { rb = swSerial.read(); }

how do you power it?

With a akku.
I also thought of voltage fluctuation or that the wlan signal is shielded by the case (a plastic box) where the ESP8266 is in it.

nuon:
With a akku.
I also thought of voltage fluctuation

So power it differently and see if the problem persists, the ESP takes quite a lot of power and the first thing to go is the WIFI which can demand up to 250mA. You may also just add a big capacitor to deal with current spikes.

nuon:
that the wlan signal is shielded by the case (a plastic box) where the ESP8266 is in it.

Nope that's not it

Does it make sense to monitor the voltage with ESP.getVcc()?
Is it precise enough to find such a voltage decrease that possibly causes the wlan disconnects?
What would be the minimum voltage for a stable wlan connection?