|
1 | 1 | <?php |
2 | 2 |
|
3 | | -// config for Uzhlaravel/Telegramlogs |
4 | 3 | return [ |
| 4 | + /* |
| 5 | + |-------------------------------------------------------------------------- |
| 6 | + | Telegram Bot Token |
| 7 | + |-------------------------------------------------------------------------- |
| 8 | + | |
| 9 | + | Your Telegram bot API token. Create a new bot by talking to @BotFather |
| 10 | + | on Telegram and paste the token here. |
| 11 | + | |
| 12 | + */ |
5 | 13 | 'bot_token' => env('TELEGRAM_BOT_TOKEN'), |
| 14 | + |
| 15 | + /* |
| 16 | + |-------------------------------------------------------------------------- |
| 17 | + | Telegram Chat ID |
| 18 | + |-------------------------------------------------------------------------- |
| 19 | + | |
| 20 | + | The chat ID where logs will be sent. For channels use @channelname, |
| 21 | + | for groups use the numeric ID (with negative sign for supergroups). |
| 22 | + | |
| 23 | + */ |
6 | 24 | 'chat_id' => env('TELEGRAM_CHAT_ID'), |
7 | | - 'topic_id' => env('TELEGRAM_TOPIC_ID'), // Optional for group topics |
8 | 25 |
|
| 26 | + /* |
| 27 | + |-------------------------------------------------------------------------- |
| 28 | + | Telegram Topic ID |
| 29 | + |-------------------------------------------------------------------------- |
| 30 | + | |
| 31 | + | Optional thread ID in a forum-style group where logs will be sent. |
| 32 | + | Only applicable for groups that have topics enabled. |
| 33 | + | |
| 34 | + */ |
| 35 | + 'topic_id' => env('TELEGRAM_TOPIC_ID', null), |
| 36 | + |
| 37 | + /* |
| 38 | + |-------------------------------------------------------------------------- |
| 39 | + | Default Logging Level |
| 40 | + |-------------------------------------------------------------------------- |
| 41 | + | |
| 42 | + | The minimum log level that will be sent to Telegram. Available levels: |
| 43 | + | emergency, alert, critical, error, warning, notice, info, debug |
| 44 | + | |
| 45 | + */ |
| 46 | + 'level' => env('TELEGRAM_LOG_LEVEL', 'critical'), |
| 47 | + |
| 48 | + /* |
| 49 | + |-------------------------------------------------------------------------- |
| 50 | + | HTTP Timeout |
| 51 | + |-------------------------------------------------------------------------- |
| 52 | + | |
| 53 | + | Timeout in seconds for requests to Telegram's API. |
| 54 | + | |
| 55 | + */ |
| 56 | + 'timeout' => env('TELEGRAM_TIMEOUT', 10), |
| 57 | + |
| 58 | + /* |
| 59 | + |-------------------------------------------------------------------------- |
| 60 | + | Message Formatting |
| 61 | + |-------------------------------------------------------------------------- |
| 62 | + */ |
| 63 | + 'formatting' => [ |
| 64 | + /* |
| 65 | + |---------------------------------------------------------------------- |
| 66 | + | Parse Mode |
| 67 | + |---------------------------------------------------------------------- |
| 68 | + | |
| 69 | + | Telegram message formatting style. Supported values: |
| 70 | + | 'MarkdownV2', 'HTML', or null for plain text |
| 71 | + | |
| 72 | + */ |
| 73 | + 'parse_mode' => 'MarkdownV2', |
| 74 | + |
| 75 | + /* |
| 76 | + |---------------------------------------------------------------------- |
| 77 | + | Include Context |
| 78 | + |---------------------------------------------------------------------- |
| 79 | + | |
| 80 | + | Whether to include context data with log messages. |
| 81 | + | |
| 82 | + */ |
| 83 | + 'include_context' => true, |
| 84 | + |
| 85 | + /* |
| 86 | + |---------------------------------------------------------------------- |
| 87 | + | Include Stack Trace |
| 88 | + |---------------------------------------------------------------------- |
| 89 | + | |
| 90 | + | Whether to include stack traces for error-level logs. |
| 91 | + | |
| 92 | + */ |
| 93 | + 'include_stack_trace' => true, |
| 94 | + ], |
| 95 | + |
| 96 | + /* |
| 97 | + |-------------------------------------------------------------------------- |
| 98 | + | Message Handling |
| 99 | + |-------------------------------------------------------------------------- |
| 100 | + */ |
| 101 | + 'message' => [ |
| 102 | + /* |
| 103 | + |---------------------------------------------------------------------- |
| 104 | + | Split Long Messages |
| 105 | + |---------------------------------------------------------------------- |
| 106 | + | |
| 107 | + | Whether to automatically split messages longer than Telegram's 4096 |
| 108 | + | character limit into multiple messages. |
| 109 | + | |
| 110 | + */ |
| 111 | + 'split_long_messages' => true, |
| 112 | + |
| 113 | + /* |
| 114 | + |---------------------------------------------------------------------- |
| 115 | + | Max Message Length |
| 116 | + |---------------------------------------------------------------------- |
| 117 | + | |
| 118 | + | Maximum length for each message before splitting occurs. |
| 119 | + | |
| 120 | + */ |
| 121 | + 'max_length' => 4000, // Slightly under 4096 for safety |
| 122 | + ], |
| 123 | + |
| 124 | + /* |
| 125 | + |-------------------------------------------------------------------------- |
| 126 | + | Logging Channels Configuration |
| 127 | + |-------------------------------------------------------------------------- |
| 128 | + | |
| 129 | + | Pre-configured logging channel for Laravel's logging system. |
| 130 | + | |
| 131 | + */ |
9 | 132 | 'channels' => [ |
10 | 133 | 'telegram' => [ |
11 | 134 | 'driver' => 'custom', |
12 | | - 'via' => Uzhlaravel\Telegramlogs\Telegramlogs::class, |
13 | | - 'level' => 'critical', |
| 135 | + 'via' => \Uzhlaravel\Telegramlogs\Telegramlogs::class, |
| 136 | + 'level' => env('TELEGRAM_LOG_LEVEL', 'critical'), |
| 137 | + 'ignore_empty_messages' => true, |
14 | 138 | ], |
15 | 139 | ], |
16 | 140 | ]; |
0 commit comments