php(exec)如何在生成的日志文件中添加新行?

exec("php gmail-smtp.php >> basic-email-template/debug-mailer.log");

I want log file messages to start on new line. But I cannot find relevant info about bash pipes.

The problem could lie inside your logger file. I.e. you're using >> correctly.

Single line in result file could be because your logger gmail-smtp.php is writing log entries as a single line (without line-break delimiter). Check that first.

I can't give you the right answer according the way you do it, but why dont you just do this:

file_put_contents('basic-email-template/debug-mailer.log', " ", FILE_APPEND)