Explain the difference between an API-based integration and agent-based log collection, outlining the security and performance trade-offs of each.