When and how are logs transformed the elastic-agent collects

Hi there,
we are running multiple web-applications (symfony) distributed over multiple server. Now we want to have a centralized place for the logs.
I've set up the ELK-Stack (OK, to be honest... i've registered an cloud-account :wink:)
As far as i've seen, the way to go is to run either elastic agents on the different servers or log to rabbit-mq.
Now.. the elastic agent is running, reads the log-files and pushes it to ELK :white_check_mark:
What i am struggling with is where i have to interpret and transform the log-files. My application (monolog) would be able to write the log-files formatted as "logstash" or "gelf" (beside other formats)
Whats the way to go?
(a) write to files or (b) write to rabbitMq
let my application write a specific format? if yes, which one and who is responsible for interpreting (elastic-agent or someone afterwards?)
thanks!