Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Disable statistics?


Go to End
Reply

13 Posts   5442 Views

Avatar
superautomatic

5 March 2008 at 3:56am Community Member, 53 Posts

Hi, I'd like to disable statistics logging, but I can't find any information on how to do that. Suggestions?

Avatar
mundgold

13 March 2008 at 3:15am Community Member, 19 Posts

Hi, this worked for me - quick and dirty:

sapphire/core/control/ContentController.php
line 76 - public function init()
      
//Statistics::collect();

Avatar
superautomatic

27 March 2008 at 1:22am Community Member, 53 Posts

Thanks!

I'm really starting to think that Silverstripe needs a basic control panel for stuff like this.

Avatar
Liam

27 March 2008 at 5:58am Community Member, 470 Posts

Great tip. I agree that having a settings page would be nice, but it goes against what the developers want SS to be according to one of the pages in the community section.

Is there a way to remove the stats link all together in the admin panel?

Avatar
dio5

28 March 2008 at 3:26am (Last edited: 28 March 2008 3:43am), Community Member, 501 Posts

I really think statistics should be a module apart from the standard package. Most people will might want to use other tools for that anyway and last time I checked the stat section was broken, i.e. getting huge out of memory errors (bug's already reported).

Avatar
Liam

28 March 2008 at 6:24am (Last edited: 28 March 2008 7:08am), Community Member, 470 Posts

I would agree and I believe it is happening. I remember reading that the Stats and NewsLetter will become modules and removed from the core.

*Edit* Oh, and I found out how to remove it or any link from the admin panel from the good ol' documentation.

Add this to your mysite/_config.php file. Make sure you disable it first, or it'll still log everything and make your database larger.

Object::addStaticVars('LeftAndMain', array(
'removed_menu_items' => array(
      'statistics',
   )
));

Avatar
Ingo

29 March 2008 at 4:32pm Forum Moderator, 801 Posts

its in the works, statistics will be an optional module thats not distributed with the core starting from 2.2.3 (see http://open.silverstripe.com/ticket/2145#comment:2)

Avatar
NickJacobs

14 October 2008 at 10:10am Community Member, 144 Posts

Hi, can this method (LeeUm above) be used to remove other menu items, ie Newsletters?

I tried this:

Object::addStaticVars('LeftAndMain', array(
'removed_menu_items' => array(
'statistics','newsletters',
)
));

but it didn't work...any ideas?

Go to Top