Added more debug logging
This commit is contained in:
parent
675cc3c329
commit
bea83b650c
|
@ -7,6 +7,7 @@ use App\Options as Option;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class OptionsController extends Controller
|
class OptionsController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -29,17 +30,33 @@ class OptionsController extends Controller
|
||||||
{
|
{
|
||||||
if (Auth::user()->can('admin.settings.edit'))
|
if (Auth::user()->can('admin.settings.edit'))
|
||||||
{
|
{
|
||||||
|
Log::debug('Updating application options', [
|
||||||
|
'ip' => $request->ip(),
|
||||||
|
'ua' => $request->userAgent(),
|
||||||
|
'username' => Auth::user()->name
|
||||||
|
]);
|
||||||
foreach($request->all() as $optionName => $option)
|
foreach($request->all() as $optionName => $option)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Options::optionExists($option))
|
Log::debug('Going through option ' . $optionName);
|
||||||
|
if (Options::optionExists($optionName))
|
||||||
{
|
{
|
||||||
|
Log::debug('Option exists, updating to new values', [
|
||||||
|
'opt' => $optionName,
|
||||||
|
'new_value' => $option
|
||||||
|
]);
|
||||||
Options::changeOption($optionName, $option);
|
Options::changeOption($optionName, $option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(\Exception $ex)
|
catch(\Exception $ex)
|
||||||
{
|
{
|
||||||
|
Log::error('Unable to update options!', [
|
||||||
|
'msg' => $ex->getMessage(),
|
||||||
|
'trace' => $ex->getTraceAsString()
|
||||||
|
]);
|
||||||
|
report($ex);
|
||||||
|
|
||||||
$errorCond = true;
|
$errorCond = true;
|
||||||
$request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage());
|
$request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue