Hello
I can use echo to display something in the screen. However, how I can print something from a php script to a log file. Can I do that. I am using php with apache server
Many thanks
shoa
print to a log file
Moderator: General Moderators
You might find the filesystem functions useful, http://de2.php.net/manual/en/ref.filesystem.php
The quickest way is to use the error_log() function.
By default this will send a string to the apache error log (your/path/to/apache/logs/error_log)
You can also make it do other things depending on the parameters you pass
error_log('Send me something',1,'myemail@example.com');
Would send the message to an email address.
By default this will send a string to the apache error log (your/path/to/apache/logs/error_log)
You can also make it do other things depending on the parameters you pass
error_log('Send me something',1,'myemail@example.com');
Would send the message to an email address.
Thanks all
thanks all for your help
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA