What is your environment? local laptop, linux VM, kubernetes cluster, ... ?
You don't use curl for logging except in demonstrations.
In production you would want to use a log forwarder like vector or fluentbit. If your environment is kubernetes, then use this guide - https://openobserve.ai/blog/how-to-send-kubernetes-logs-usin... .
If something else let us know, and we can have a guide. fluentbit and vector are fairly well documented and have been there for years now. I would recommend you to check them out. OTEL-collector is a good option too.