php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20499 No newline operation in error_log()
Submitted: 2002-11-19 12:52 UTC Modified: 2002-11-19 12:54 UTC
From: peter dot loleit at sitelynx dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.2.3 OS: Linux
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: peter dot loleit at sitelynx dot com
New email:
PHP Version: OS:

 

 [2002-11-19 12:52 UTC] peter dot loleit at sitelynx dot com
I have been trying to use newline operators and tabs in the error_log() function but for some reason they are treated as literals and I can not get newlines written into the logfile nor tabs.

as you can see bellow I have tried it with an array element and a string also with \r\n or \n or \\n or \n\n.. no joy I just get everything appended to the same line.. shame


//example line: error_log($error[0|1][n],3,$errorLog);
// timestamp for the error entry
$dt = date("Y-m-d H:i:s");


///////////////
$error[0][0]	= '\t' .$dt. 'Failure: capture HTTP page request variable\n';//mark [FATAL]
//$error[1][0]	= '\t' .$dt. 'Success: capture HTTP page request variable\n';
$errorString	= '\t' .$dt. '\tSuccess: capture HTTP page request variable\r\n';
$error[0][1]	= '\t' .$dt. 'Failure: capture HTTP method request variable\n';//mark [WARNING]

//script excerpt

if ($request = getenv('REQUEST_URI')) {
	error_log($errorString,3,$errorLog);
}//end if($request..
else {
	error_log($error[0][0],3,$errorLog);
}//end else

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-19 12:54 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 14:01:33 2025 UTC