Keep Tokenview and Telegram running when log files are not writable.
Daily logs created by root cron were blocking www from appending, which aborted webhook ingest and bot pushes. File channels now use 0664 plus exception-safe stacks, and writes go through SafeLog. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Telegram\Middleware;
|
||||
|
||||
use App\Support\SafeLog;
|
||||
use App\Telegram\TelegramBotContext;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use SergiX44\Nutgram\Nutgram;
|
||||
use SergiX44\Nutgram\Telegram\Properties\ChatType;
|
||||
|
||||
@@ -21,7 +21,7 @@ class AuthorizedChat
|
||||
{
|
||||
$chatId = $bot->chatId();
|
||||
if (! $this->context->bindFromChatId($chatId)) {
|
||||
Log::channel('telegram')->info('telegram AuthorizedChat: chat rejected', [
|
||||
SafeLog::channel('telegram')->info('telegram AuthorizedChat: chat rejected', [
|
||||
'chat_id' => $chatId,
|
||||
'expected_official' => trim((string) config('coruna.telegram.owner_chat_id', '')),
|
||||
]);
|
||||
@@ -32,7 +32,7 @@ class AuthorizedChat
|
||||
$type = $bot->chat()?->type;
|
||||
$typeValue = $type instanceof ChatType ? $type->value : (string) $type;
|
||||
if (! in_array($typeValue, [ChatType::GROUP->value, ChatType::SUPERGROUP->value, 'group', 'supergroup'], true)) {
|
||||
Log::channel('telegram')->info('telegram AuthorizedChat: not a group chat', [
|
||||
SafeLog::channel('telegram')->info('telegram AuthorizedChat: not a group chat', [
|
||||
'chat_id' => $chatId,
|
||||
'type' => $typeValue,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user