review.log not being created
deekayen - November 3, 2009 - 19:19
| Project: | Project Issue File Review |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | boombatower |
| Status: | fixed |
Description
Jimmy said a review.log file was supposed to be created for each test on the client, but it doesn't appear to be written anywhere in the web tree nor is it generating an error about it not writing that I can find. When I hard coded a path, it wrote where I told it to.

#1
Can you print out file_directory_path() to hard coded log file and see if it is right?
That and print the whole generated url.
#2
file_directory_path == sites/default/files$this->log_file == ''
/me aims blame at realpath()
#3
Perhaps it has an issue if the file does not exist first, although if you hard coded...not really sure.
If this doesn't work perhaps, try adding './' in front.
#4
I think that patch is going to do exactly the same thing - all you did was break it up over two lines.
#5
I tried
$this->log_file = realpath('./'. file_directory_path() . '/review.log');and still no log_file value.I'm interested to see how you'll derive a full path - I have a custom module at Classic Graphics where I ended up coding a configuration variable for it cause I didn't get it figured out quick enough.
#6
I would really like to know why this doesn't work. Makes absolutely no sense.
http://us3.php.net/manual/en/function.realpath.php
If it can't handle the fact the file is not there then #3 should do fine, but otherwise I am lost. Works like a charm locally.
#7
I stumbled over exactly this issue, and have an explanation:
realpath() returns an empty string if the file doesn't exist. In my case, a realpath("sites/default/files") did work, but a realpath("sites/default/files/review.log") did not unless the file was manually created. This is either a bug or a documentation issue; I believe it is a little bit of both. As a temporary fix, it is possible to simply create the file.
#8
I did this on #34 - let's see how it goes after a couple tests:
cd /var/www/sites/default/filestouch review.log
chmod 777 review.log
chown www-data:www-data review.log
#9
The log contents are reported at http://qa.drupal.org/pifr/test/16620 as they should be (I think). Now I guess the question is whether or not the creation of review.log should be done through PIFR's installer or as part of the client configuration and setup. Personally, I think touching the file is very workaround-ish, so I'm leaving this open rather than changing my PIFR setup instructions.
#10
I'm trying this patch on #34:
<?php// Initialize the log file.
+ touch(file_directory_path() . '/review.log');
$this->log_file = realpath(file_directory_path() . '/review.log');
$this->log('Log initialzed.');
?>
#11
#12
Seems to work. http://qa.drupal.org/pifr/test/20292
Re: my email, after this is committed, please comment on which branch or tag to update our clients from CVS.
#13
That is exactly what I did in #3...?
#14
mm... i guess.
I like mine better :) I already added review.log to all three live testing clients and added it to the install instructions anyway.
Perhaps adding a comment to the usage of realpath there would be helpful about needing the file to exist first since the only docs on that fact are a comment on the doc page.
There's a resolution somewhere in this thread, whichever one you pick. I'll be ignoring it now.
#15
Committed your solution.