Importing Apache access log to ezview_counter

Author Message

Eivind Marienborg

Friday 04 March 2005 12:35:31 am

I'm trying to set up a list of the most viewed nodes on my site, using view_top_list (http://ez.no/ez_publish/documentation/reference/data_fetching/content/view_top_list).

I've run the cronjob importing the access_log, the script runs for quite some time, but when it's done there's no entries in table ezview_counter (that I assume stores the stats), and nothing's outputted through view_top_list.

I'm sure the cronjob finds the file (because of the time it takes to run the script through). This is the output:

Running cronjob part 'log'
Running cronjobs/updateviewcount.php
Update content view count ...
Started at 04. mars 2005 09:15:56

Start line:

Finished at 04. mars 2005 09:16:09

View count have been updated!

No errors, but no start line either.

I haven't found any docs on this.. Does the access_log need a specific format for the script to work? Are there other things that might mess this up? Any help or hint is greatly appriciated :)

- Eivind

Łukasz Serwatka

Friday 04 March 2005 12:51:11 am

Hi Eivind,

Try to create dir "log" in your var/(cache_dir)/ and run your cronjobs script.

Make sure that you add correct path to your apache log file. PHP should have read access to this file.

I hope it will help.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Eivind Marienborg

Friday 04 March 2005 1:17:53 am

Thanks for quick reply, and congrats on the system crew status :)

I assume the path is correct, simply because it takes longer to run now then if I enter a obviously wrong path.

There's already a var/log directory. But there's no updateview.log created. Could this mean that php doesn't have write access here? And should that really matter - Should it fail just because it can't write the log?

This is a line from the access log, could there be anything wrong with it? (IP altered for privacy reasons)

0.0.98.76 - - [04/Mar/2005:09:09:31 +0100] "GET /siteaccess/content/view/full/27370 HTTP/1.0" 200 19944

Łukasz Serwatka

Friday 04 March 2005 1:21:35 am

Hi Eivind,

Thank you. Try create "log" dir in your var/(prefix)/. For example /var/news/log not in var because there already exists log dir as you wrote.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Eivind Marienborg

Friday 04 March 2005 1:29:52 am

Great! :) At least it creates the log now, and skips the parts it has already parsed. But it still doesn't insert anything into DB. Can I enable a debug mode for this script some how?

Stéphane Bullier

Monday 16 April 2007 5:01:18 am

Hello,

I try to make fetch of 'view_top_list'. When I run "runcronjobs" manually with -d option, there is this message :

Timing: ()
Script cronjobs/updateviewcount.php starting

Warning: (PHP)
Undefined offset:  1 in /usr/home/usr2/ezpublish-3.9.0/cronjobs/updateviewcount.php on line 117

Warning: (PHP)
Undefined offset:  1 in /usr/home/usr2/ezpublish-3.9.0/cronjobs/updateviewcount.php on line 118

Warning: (PHP)
Undefined offset:  1 in /usr/home/usr2/ezpublish-3.9.0/cronjobs/updateviewcount.php on line 122

Warning: (PHP)
Undefined offset:  1 in /usr/home/usr2/ezpublish-3.9.0/cronjobs/updateviewcount.php on line 124

Timing: ()
Script cronjobs/updateviewcount.php done

How is possible to correct this ?

Stéphane

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:15:22
Script start
Timing: Jan 18 2025 19:15:22
Module start 'layout'
Timing: Jan 18 2025 19:15:22
Module start 'content'
Timing: Jan 18 2025 19:15:23
Module end 'content'
Timing: Jan 18 2025 19:15:23
Script end

Main resources:

Total runtime0.7138 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.1563152.6406
Module start 'layout' 0.00530.0045 741.796939.4766
Module start 'content' 0.00980.7027 781.2734625.2422
Module end 'content' 0.71260.0012 1,406.515616.1250
Script end 0.7138  1,422.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4439160.0002
Check MTime0.00140.1904160.0001
Mysql Total
Database connection0.00070.095510.0007
Mysqli_queries0.646790.6002680.0095
Looping result0.00080.1136660.0000
Template Total0.682495.620.3412
Template load0.00210.294820.0011
Template processing0.680395.307020.3401
Template load and register function0.00010.014310.0001
states
state_id_array0.00090.131710.0009
state_identifier_array0.00140.195020.0007
Override
Cache load0.00180.2589370.0000
Sytem overhead
Fetch class attribute can translate value0.00070.099930.0002
Fetch class attribute name0.00180.246790.0002
XML
Image XML parsing0.00140.190130.0005
class_abstraction
Instantiating content class attribute0.00000.0030120.0000
General
dbfile0.00100.1376300.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs