Project

General

Profile

Actions

Feature #14203

closed

logging did not work

Added by Daniel Poetzinger over 20 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2004-06-14
Due date:
% Done:

0%

Estimated time:
PHP Version:
4
Tags:
Complexity:
Sprint Focus:

Description

In V 3.6.1 in class.tslib_fe.php there are changes in the function statistics()

I wonder because Logging did not work anymore, in Version 3.6.0 it does!

The error is that the constant PATH_site was added before $this->config['stat_vars']['logFile']..

Solution for me was to delete PATH_site on this place.

This did not make any sense and people updating would wonder as I did.

The logfile is not under the Site-path (security reasons) and awstat dont know were to look for logfiles....

(issue imported from #M159)


Files

0000159-statistics.txt (4.33 KB) 0000159-statistics.txt Administrator Admin, 2004-07-02 22:09
0000159-class.tslib_fe.php.diff (1.13 KB) 0000159-class.tslib_fe.php.diff Administrator Admin, 2004-07-05 01:28
0000159-class.tslib_fe.diff (3.9 KB) 0000159-class.tslib_fe.diff Administrator Admin, 2004-07-05 16:35
Actions #1

Updated by Michael Stucki over 20 years ago

According to [1] there were no changes in class.tslib_fe.php between 3.6.0 and 3.6.1.

Can you please recheck?

[1] http://cvs.sourceforge.net/viewcvs.py/typo3/TYPO3core/typo3/sysext/cms/tslib/class.tslib_fe.php?only_with_tag=TYPO3_3-6-0

Actions #2

Updated by Daniel Poetzinger over 20 years ago

? solved but not tested?
I wonder because I must change this file in two of your client servers..

There are definitly changes in the function statistics() see the description.
It works with 3.6.0RC1 which seems not to be tagged or whatever..

If there is a solution without changing the source it is ok .

I added the Version of the function which was actual since 3.6.0RC as an attachment!

bearbeitet am: 02.07.04 22:08

bearbeitet am: 02.07.04 22:09

Actions #3

Updated by Michael Stucki over 20 years ago

Ah, I see. The problem was introduced with revision 1.11 (Fixed lots of issues related to safe_mode and open_basedir. Should all work now!)

Actions #4

Updated by Michael Stucki over 20 years ago

This patch should do the trick. Please confirm, thanks.

Actions #5

Updated by Daniel Poetzinger over 20 years ago

It works but:

This line makes no sense:
if(!ereg("^/", $logFileName)) $logFileName = PATH_site.$logFileName;

look at function getConfigArray().:
...
// STAT:
$theLogFile = $this->TYPO3_CONF_VARS['FE']['logfile_dir'].$this->config['config']['stat_apache_logfile'];
if ($this->config['config']['stat_apache'] &&
$this->config['config']['stat_apache_logfile'] &&
!strstr($this->config['config']['stat_apache_logfile'],'/') &&
@is_dir($this->TYPO3_CONF_VARS['FE']['logfile_dir']) && @is_file($theLogFile) && @is_writeable($theLogFile)) {
$this->config['stat_vars']['logFile'] = $theLogFile;

As you see:

This function checks if $logFileName exist, if not the needed $this->config['stat_vars'] is not filled so stat is not printed.
You have to add this in this function and have to set $this->config['stat_vars']['logFile'].
Byside - why use ereg and not strstr which is faster?

Additionaly an logmessage would be nice in this functiomn getConfigArray like:
else {
$GLOBALS['TT']->push('Could not set config array for statistic. (check logfile and permissions)','');
}

bearbeitet am: 05.07.04 11:15

Actions #6

Updated by Michael Stucki over 20 years ago

You're right, thanks. I have attached a new patch. Didn't test it, so please confirm if this works...

Actions #7

Updated by Ingmar Schlecht over 20 years ago

As soon as Stucki's patch is confirmed to work, it can go into 3.7.

So anyone tested it?

Actions #8

Updated by Michael Stucki about 20 years ago

Fixed now. Please test this in the 3.7RC!

Actions #9

Updated by Daniel Poetzinger over 19 years ago

The Bug appears again in 3.7.0

Why is the logPath checked with:
t3lib_div::isAllowedAbsPath

I dont want to log into the Pathsite!
Please remove this check, it makes bo sense here , right?

Greetings

Actions #10

Updated by Daniel Poetzinger about 19 years ago

It is still not possible to log outside the sitepath.

It is a securityhole to have the logfile available under the webrootpath.

Actions #11

Updated by Michael Stucki about 19 years ago

It is possible if you add your logfile path to TYPO3_CONF_VARS[BE][lockRootPath].

Actions

Also available in: Atom PDF