I'm trying to get Silverstripe to log errors but no success, this is the best I get out of it:
"Parse error: syntax error, unexpected '}' in /vagrant/website/mysite/code/Controllers/PageController.php on line 10"
Only the normal PHP error message, no framework call stack or similar!
The reason I need it is because I want to log errors to Sentry, but I can't even log it to the file system, most likely because Silverstripe's call stack isn't being triggered at all, I'm falling back to PHP's error stack.
I'm using Silverstripe 3.5, here's my _ss_environment.php:
<?php
define('SS_DATABASE_CLASS', 'MySQLPDODatabase');
define('SS_DATABASE_SERVER', 'localhost');
define('SS_DATABASE_USERNAME', 'vagrant');
define('SS_DATABASE_PASSWORD', 'vagrant');
define('SS_DATABASE_NAME', 'ccf_website');
define('SS_DATABASE_CHOOSE_NAME', false);
define('SS_DATABASE_TIMEZONE', 'NZST');
define('SS_DEFAULT_ADMIN_USERNAME', 'sadasda@assaddsa.com');
define('SS_DEFAULT_ADMIN_PASSWORD', 'dev');
define('SS_ENVIRONMENT_TYPE', 'dev');
Here's _config.php:
<?php
require_once('conf/ConfigureFromEnv.php');
global $project;
$project = 'mysite';
global $databaseConfig;
$databaseConfig = [
'type' => SS_DATABASE_CLASS,
'server' => SS_DATABASE_SERVER,
'username' => SS_DATABASE_USERNAME,
'password' => SS_DATABASE_PASSWORD,
'database' => SS_DATABASE_NAME,
'path' => ''
];
// Set the site locale
i18n::set_locale('en_US');
Security::setDefaultAdmin('eduardo@pixelfusion.co.nz', 'dev');
// log errors and warnings
SS_Log::add_writer(new SS_LogFileWriter('../silverstripe-errors.log'), SS_Log::NOTICE, '<=');