getCode(); $context['message'] = sanitize_root($e->getMessage()); $context['file'] = sanitize_root($e->getFile()); $context['line'] = $e->getLine(); $context['url'] = get_current_url(); $context['trace'] = trace_to_call_points(trace_from_exception($e)); // Don't log these exceptions $ignoredExceptions = [ 'You must specify a format', 'Format name invalid', 'Unknown format given', 'Bridge name invalid', 'Invalid action', 'twitter: No results for this query', // telegram 'Unable to find channel. The channel is non-existing or non-public', // fb 'This group is not public! RSS-Bridge only supports public groups!', ]; foreach ($ignoredExceptions as $ignoredException) { if (str_starts_with($e->getMessage(), $ignoredException)) { return; } } } // Intentionally not sanitizing $message $text = sprintf( "[%s] rssbridge.%s %s %s\n", now()->format('Y-m-d H:i:s'), $level, $message, $context ? Json::encode($context) : '' ); // Log to stderr/stdout whatever that is error_log($text); } }