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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC