Generating logs and extracting them programmatically

Hi Experts, I would like to get some insights on how to generate log information from an app and programmatically retrieve them for indexing on a SIEM.

Are there any APIs for this scenario?

Thank you