Logging module

IamNear

Joined: 2006-03-08
Posts: 57
Posted: Mon, 2006-03-20 09:25

Is there a module available that allows you to view logged hits of each IP address? Example attached.

AttachmentSize
logs.PNG31.88 KB
 
scaturan
scaturan's picture

Joined: 2004-09-12
Posts: 1153
Posted: Mon, 2006-03-20 12:26
 
IamNear

Joined: 2006-03-08
Posts: 57
Posted: Mon, 2006-03-20 15:55

Thank you for pointing me in the right direction, its amazing that this feature is not part of the script by default. Please support this module develoment with your vote -- http://gallery.menalto.com/sfvote/vote/1295162

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Tue, 2006-03-21 17:52

It isn't really *that* amazing that it isn't already written. As an open source project, the developers add features that a) are very popular and/or b) they are interested in themselves. As you can see from the sfvote page, it isn't in the top 10 of requested features, thought it is in the top 20 at least. So if you like the idea and can do more than vote for it, your chances of getting the module are much better. This could include coding it yourself, offering a reward for someone to code it or even hiring some developer (a gallery dev or just someone good at php) to do it. Either way, the G2 dev team is happy to help anyone working on modules for G2!

All that said, there are perhaps some useful alternatives out there. Your webserver already keeps a log of everyone that visits your site... why bother duplicating the effort? You can use some 3rd party tools like webalizer or awstats to process your logs and get a wide variety of information. Google has an "Analytics" service that works by inserting some java code in all your pages and then can provide you with *very* detailed and interesting statistics about your visitors. So you have lots of non-G2 options that are arguably better than anything that could be designed as a G2 module.
_________________________________
Support & Documentation || Donate to Gallery || My Website

 
scaturan
scaturan's picture

Joined: 2004-09-12
Posts: 1153
Posted: Tue, 2006-03-21 18:07

yep, i agree with fryfrog. modern web hosting providers will provide you statistics, and there's lots of 3rd party free statistics providers that can explore, as fryfrog suggested.

 
IamNear

Joined: 2006-03-08
Posts: 57
Posted: Wed, 2006-03-22 13:01

I disagree, general site logs do not give specific information on individual user sessions from what images (and for how long) a user views -- to tracking their entire gallery viewing sessions.

For example, as far as I'm aware webalizer, awstat logs etc do not have the ability to identify a registered user and display a full log of when and what they look at. Or linking a user to a guest comment etc... The ability to identify users by what photos they look at (people generally only look at items relevant to them i.e. photos of themselves) in a simple, easy to use interface is a must module in my opinion.

I'm not a developer, would anyone be prepared to develop this module? For a fee?

Edit:
Check out my original attached image for a simple example.

 
IamNear

Joined: 2006-03-08
Posts: 57
Posted: Tue, 2006-03-28 10:04

Anyone interested for a fee?

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Tue, 2007-12-25 20:19

I'm game. I figure it's time for Open Web Analytics (http://www.openwebanalytics.com) to have a Gallery plugin. We already have one for Wordpress and MediaWiki.

I've already got a Module for Gallery 2.2 started, but just need to figure out how to call some code on every request from _within_ a module (i.e. without hacking main.php). I don't think there is a callback that is called on every request...

Anyone have any ideas?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-12-25 23:27

we've recently answered similar questions since someone added support for another web statistics tool: http://codex.gallery2.org/Gallery2:Modules:firestats.

there's no hook that gets called on each request yet. i wonder where we discussed this, it doesn't seem to be in the forum. maybe in the irc channel?
some related words:
http://tools.gallery2.org/glogs/?fulltext=on&search=omry

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Fri, 2007-12-28 21:37

It seems that the way that the firestats module handles this is to register an authPlugin with a priority of 1 that does not return a valid user object. The fact that the plugin does not return a valid user object causes gallery to move along to the next registered authPlugin and see if it gets a valid user object from it (which it will).

This definitely works but it means that the code one is trying to execute does not have access to gallery's active user object, because it is executed before the valid authPlugin executes.

Neat hack, but definitely not the way I would have expected this to work.

Seems to me that Gallery should follow what other frameworks do and expose some additional event hooks, specifically:

* Init - would fire on Gallery initializing
* Render - would fire whenever a view was rendered
* Auth - a true auth event that would fire when a valid user object is created.

These would be infinity valuable for creating a tracking/logging module.

That said, I'll try to hack around not having access to the user object and see what I can do.

I wonder if there are other factory implementations that get called on every request and work like the authPlugin does with priorities and chaining etc.. Anyone know?

-P-

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-12-29 00:24

Correct assessment. Not sure if we need all of the events you mention, but we certainly need a real per-request event.

And no, there are no better alternatives to our knowledge. The auth stuff is the best emulation we can offer at the moment.

In G2.3 there's another event that gets fired later in the request (so you have your active user).
See:
- http://codex.gallery2.org/Gallery2:Events
- http://codex.gallery2.org/Gallery2:Theme_Override_By_Event

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Sat, 2008-02-02 08:13

ok I finally got a release out for this.

I'm pleased to announce the release of Open Web Analytics for Gallery2.

Open Web Analytics (OWA) is a popular open source web analytics framework that provided built-in support for tracking WordPress, MediaWiki and now Gallery2 based sites.

OWA installs as Gallery2 plugin and provides the following features to Gallery2 users out of the box:

- Tracks all the typical visitor and session metrics as well as Gallery2 album and item page views.
- Album and item meta-data is automatically used to describe pages
- installs as regular one-click gallery plugin (see http://wiki.openwebanalytics.com for install instructions)
- utilizes Gallery2 user authentication to keep stats private
- Analytics displayed as Gallery2 site admin screen

Currently requires Gallery v2.2.4.

You can grab the code from here: http://downloads.openwebanalytics.com/owa/owa_1_1_0rc2.tar

Please give it a try and let me know as you come across bugs or issues.

enjoy.

-P-

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2008-02-03 20:19

padams66,

When I try to activate your module I get this in the firefox debug window:

Quote:
syntax error
[Break on this error] var result = AdminPlugins.js (line 121)

system info:

Quote:
Gallery version = 2.2.2 core 1.2.0.4
PHP version = 5.2.0 cgi-fcgi
Webserver = Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database = mysqli 4.1.14-Debian_5-log, lock.system=flock
Toolkits = NetPBM, ImageMagick, Gd, Thumbnail, LinkItemToolkit, Ffmpeg, Getid3, Exif, Dcraw
Acceleration = full/3600, none/900
Operating system = Linux western 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+++opt+c6+gr2b-v6.192 #1 SMP Wed Dec 14 17:06:16 PST 2005 i686
Default theme = nzdi
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Rows in GalleryAccessMap table = 66
Rows in GalleryAccessSubscriberMap table = 2402
Rows in GalleryUser table = 3
Rows in GalleryItem table = 2386
Rows in GalleryAlbumItem table = 100
Rows in GalleryCacheMap table = 20453

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Sun, 2008-02-03 21:22

Looks like a gallery error. I'll take a look.

I have only tested this version of OWA with Gallery 2.2.4.

Any chance you can upgrade to that and see if it fixes the problem.

-P-

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2008-02-03 21:37

Sorry I should have clicked the run now button ( Yah I should know right ;-) ) for they system maint/version info.
It was at 2.2.4

Quote:
Get system details; useful for copy/paste into G2 support forum.

Last Run Details:

Gallery version = 2.2.4 core 1.2.0.6
PHP version = 5.2.3 cgi-fcgi
Webserver = Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.8 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database = mysqli 4.1.14-Debian_5-log, lock.system=flock
Toolkits = NetPBM, ImageMagick, Gd, Thumbnail, LinkItemToolkit, Ffmpeg, Getid3, Exif, Dcraw
Acceleration = full/3600, none/900
Operating system = Linux western 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+++opt+c6+gr2b-v6.192 #1 SMP Wed Dec 14 17:06:16 PST 2005 i686
Default theme = nzdi
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Rows in GalleryAccessMap table = 206
Rows in GalleryAccessSubscriberMap table = 2404
Rows in GalleryUser table = 3
Rows in GalleryItem table = 2388
Rows in GalleryAlbumItem table = 100
Rows in GalleryCacheMap table = 25902

Sorry about that.
perhaps the upgrade code should run this maint task.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Sun, 2008-02-03 22:57

I can't seem to reproduce this. what version of firefox are you running?

The errors that are throwing relate to Gallery's javascript not the OWA plugin so I'm wondering if you can activate and install other plugins or does this just happen with OWA?

 
ben119

Joined: 2008-01-01
Posts: 24
Posted: Mon, 2008-02-04 08:50

Hi,

First of all, congratulations for adapting OWA to gallery.

I've tried to install OWA on gallery 2, but I'm stuck.
I've FTPed the files, the link to Install is available in the plugins page, but when I click install nothing happens. I've tried changing permissions on owa folder (now it's 777), but still no install.

Any help would be great, I've been looking for that kind of plugin for a long time and need it badly.

Regards,
Benoit

My gallery info :
Gallery version = 2.2.4 core 1.2.0.6
PHP version = 4.4.5-0.dotdeb.2 apache
Webserver = Off
Database = mysqlt 4.1.11-Debian_4sarge7-log, lock.system=flock
Toolkits = Gd, Exif, SquareThumb
Acceleration = none, none
Operating system = Linux 2.6.13-amd #1 SMP Fri Sep 9 14:29:02 CEST 2005 i686
Default theme = PGlightbox
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Rows in GalleryAccessMap table = 55
Rows in GalleryAccessSubscriberMap table = 63
Rows in GalleryUser table = 4
Rows in GalleryItem table = 61
Rows in GalleryAlbumItem table = 9
Rows in GalleryCacheMap table = 0

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Mon, 2008-02-04 10:02

Tested also the module.
A great module, however some errors.

1. at installation: it looks for a file named gallery_template.tpl but what it is found is a gallery2_template.tpl (cannot access right now the server, so no exact details). A symbolic link seems to solve the problem.

2. at run-time: in seems that in module.inc, the GalleryController class cannot be inherited.

I will post apache logs directly when possible.

serbanc - www.e-poze.ro

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Tue, 2008-02-12 22:43

tried today 1.1rc3
- gallery_template.tpl / gallery2_template.tpl - works if you rename file
- if trying to save settings you get an error

what info should I provide ?
serbanc - www.e-poze.ro

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Wed, 2008-02-13 21:59

commented the declaration of OWAController class and it seems to work now.
it is supposed to log users ?
serbanc - www.e-poze.ro

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Tue, 2008-02-19 05:39

ok. I've committed a number of fixes to SVN trunk for those that care to give it a whirl.
Will package up a new tar ball later this week.

thanks,

-P-

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Tue, 2008-02-19 08:02

made some modification into module.inc.
it seems to log even users, but it does not display their names, just their id's

find attached the code

serbanc - www.e-poze.ro

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Fri, 2008-02-29 08:08

ok. v1.1.0rc4 has been released and contains a bunch of fixes to the bugs that people have been kind enough to report here.
OWA should now install cleanly and links to its admin settings and analytics dashboard should show up in the Site admin nav column.

You can fetch a tar ball of the code from here: http://downloads.openwebanalytics.com/owa/owa_1_1_0rc4.tar

 
jacenty

Joined: 2008-03-18
Posts: 1
Posted: Tue, 2008-03-18 16:20

Hello!
I succesfully install OWA module in Gallery2.
Now I have strange problem:
when I load any page from gallery - browser freeze on the while (~30sec), then load page...
I try disable Geolocate, Resolve host name etc, but no luck as far - any clue what's up?

Jack

 
tonytx

Joined: 2008-04-10
Posts: 4
Posted: Thu, 2008-04-10 23:30

I want to get the installation instructions from http://wiki.openwebanalytics.com/index.php?title=Main_Page, but it appears one must be logged in even to see them ... and the login page has no way to create a new account! It says "log in / create new account," but I can't see any way to create a new account. Can anyone help me here?

 
tonytx

Joined: 2008-04-10
Posts: 4
Posted: Fri, 2008-04-11 21:44

I found the installation instructions (via Google -- links on openwebanalytics.com are still broken) ... but it failed to install. The module appeared in the Admin area, but when I clicked on Install, all that happened was that the row turned green; the module was not installed, and no error messages were given.

What's wrong here?

 
padams66

Joined: 2007-12-25
Posts: 10
Posted: Sat, 2008-04-12 01:23

Hi Onytx -

What links on openwebanalytics.com are broken? Also all the documentation is located at http://wiki.openwebanalytics.com.

Can you post what version of Gallery and OWA you are running? There is a 1.1 tar ball now that is best to try. Also OWA will produce
/path/to/owa/owa-data/logs/errors.txt that might also shed some light on what's going on or where things might be getting stuck for you..

If there are any gallery developers reading, perhaps someone could point me in the right direction of how to debug/instrument the ajax/javascript
that is the plugins roster page....

Thanks,

-P-

 
nameht

Joined: 2004-11-21
Posts: 47
Posted: Thu, 2009-06-04 21:01

the same thing happens for me, i click install and nothing happens

using gallery 2.3 and the latest OWA