Periodically the server loses the network connection to the server loki.

Periodically the server loses the network connection to the server loki. What settings alloy to make so that after the network appears it transfers the logs that have accumulated over this period?

You can try WAL, see loki.write | Grafana Alloy documentation. It’s still considered experimental on Alloy though.