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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Questions about log and dev environment


Go to End


784 Views

Avatar
suoko

Community Member, 4 Posts

8 April 2014 at 4:56am

Edited: 08/04/2014 9:05am

I read this page http://doc.silverstripe.org/framework/en/3.1/changelogs/3.1.0 where it says:

Security: Require ADMIN for ?flush=1
Flushing the various manifests (class, template, config) is performed through a GET parameter (flush=1). Since this action requires more server resources than normal requests, it can facilitate denial-of-service attacks.
To prevent this, main.php now checks and only allows the flush parameter in the following cases:
The environment is in "dev mode"
A user is logged in with ADMIN permissions
An error occurs during startup

-------------------------------

Since flush work on my site I assume it is in dev mode, however its config file doesnt have any 'environment dev' line: how is that possible?

Regarding logs, is it enough to add SS_Log::add_writer(new SS_LogFileWriter(BASE_PATH . '/mylog.log'), SS_Log::WARN); to config.php ?

Thanks

Update:
attached you can see the error that I wanna log.
It appears when I sync files but I cant understand what is that caused by since everything looks working ok anyway.
I checked the files table in the db and it gets created just fine

Re. logs, they do work if set as following so this is solved:
SS_Log::add_writer(new SS_LogEmailWriter('mymail@gmail.com'), SS_Log::WARN, '<=');
SS_Log::add_writer(new SS_LogEmailWriter('mymail@gmail. com'), SS_Log::ERR);

and here is the warning:
[Warning] file_get_contents() [function.file-get-contents]: Filename cannot be empty
/home/mhd-01/..../framework/view/SSViewer.php:1035