Log forwarding Issue with blocking and nesting

We have been trying for a while to have a robust logging solution where we send logs to external services that have better searching and indexing capabilities. Such services include BetterStack , which have a great and simple integration.

From our experience, to use any logging integration, we need to manually flush in order to send the logs, which is human-error prone. In addition, the flush call is blocking, meaning that even when the function execution is completed, realm will not release the request and return the response until the flush is complete (since we are serverless) , which degrades performance, therefore we opted for using log forwarders, which execute asynchronously.

Questions :

  1. How come the config files for the log forwarders do not have the capability to enable or disable the log forwarder? Why is it only through UI, or am I missing something?

  2. Log forwarders create logs from the execution of the (first contact function) , meaning that function which was called through the SDK or API etc, and generates a log on success or failure of execution of that function. But we can have function1 (first contact) call nested function2 → func3 and so on. The generated log from the Log forwarder does not reflect that, it only will house an array of console logs from each function grouped together without any notion on which function logged which line. Is there any way to fix this?

  3. Finally, is there a better approach than the one we currently are implementing?