php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45770 error_log entries do not have linebreaks
Submitted: 2008-08-08 23:53 UTC Modified: 2008-08-10 09:56 UTC
From: dueyduong at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.6 OS: IIS6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dueyduong at gmail dot com
New email:
PHP Version: OS:

 

 [2008-08-08 23:53 UTC] dueyduong at gmail dot com
Description:
------------
New entries in the error log file do not start on a new line.  That is, every error log seems to run continuously on one single line in the file.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-08 23:56 UTC] jani@php.net
Do you mean error_log() the function or error_log the php.ini option?
 [2008-08-09 01:00 UTC] dueyduong at gmail dot com
Sorry for not being clear to begin with -- error_log the php.ini option, not the function.
 [2008-08-09 16:45 UTC] jani@php.net
So what is it set to? PLEASE be more specific, we can't read minds..unfortunately.
 [2008-08-09 17:31 UTC] dueyduong at gmail dot com
Alright let me try again.

Ok -- display_errors is turned Off. log_errors is turned On.

error_log = "/logs/php-errors.log"

Now, when there is an error and the log file is written to, each error entry in the log file is written to the same (single) line in the log file, without any line breaks.

For example:

These options need to match
 in Unknown on line 0 [09-Aug-2008 10:24:53] PHP Parse error:  syntax error, unexpected T_ECHO in C:\...httpdocs\priv\test.php on line 5 [09-Aug-2008 10:26:18] PHP Parse error:  syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\...httpdocs\priv\test.php on line 7 [09-Aug-2008 10:26:20] PHP Parse error:  syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\...\httpdocs\priv\test.php on line 7

In this example, there were 3 instances of errors, and they should each be on a separate line in the log file. Instead, all 3 error logs are on the same single line without any line breaks between each error.

Hope that is clear now.
 [2008-08-09 19:20 UTC] jani@php.net
Works fine for me using CLI. Please try it yourself too.
 [2008-08-10 03:29 UTC] dueyduong at gmail dot com
For some reason Wordpad displays the log file all on one line (this wasn't the case w/ PHP v4.4).  I opened the log file w/ Notepad and it's fine.  Same w/ CLI ("type").  No bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 20:01:36 2025 UTC