I don't think this is an issue with Apache Web Server or mod_sec. Cloud Foundry will read logs from applications running on it, logs that are written to STDOUT/STDERR. This is the way you should be logging if you have an app running on Cloud Foundry, and if you're deploying a PHP app to Cloud Foundry that is how the PHP buildpack will configure PHP and the Apache Web Server to host your PHP application.
You cannot simply log to a file because the file system for your application running on Cloud Foundry is ephemeral. It will work during happy times, but when something fails and your app crashes it will not work. The file system, including the logs you've written to it, will be gone when the app crashes and that makes troubleshooting very difficult.
In regards to the behavior you're seeing, the Cloud Foundry logging system has size limits for a single line log entry. If you try to write a single line log entry that goes beyond the limit, the log system will automatically split the line and you'll end up with two log lines. I suspect that is what's happening here.
I did a little looking but couldn't find a documented max value for the length of a line before it'll be split. The best I could find was this discussion about the setting which provides some history about it. It doesn't seem to offer a clear explanation of how things are set up though.
Since I couldn't find an officially documented value, I wanted to test and validate the length. To do this, I deployed a test app to Pivotal Web Services (runs the latest version of OSS Cloud Foundry) and wrote some long log lines (if you'd like to see the test code, just let me know). The max I was able to get before the line is split was 61441 bytes (I repeated the a
character in my test, if you have multi-byte characters like 丂
it will split sooner). This matched the older behavior mentioned in the discussion link above. It is possible your mileage will vary, depending on the version of CF you're using and the way your platform is configured.
Regardless of the exact value for the limit, there will always be some limit. You can either try to reconstitute your log entries, i.e. stitch them back together, after the fact, or you can store the information somewhere else. Use a service like a database or send the log entries directly to syslog.
Syslog is a good option, but HTTPD's built-in support for that requires syslogd to be running locally, which it's not inside a Cloud Foundry container. It's probably easier to use the piped logging feature and use an external program to send logs out. Here's an example of doing that.