|
15 | 15 | use Guanguans\LaravelExceptionNotify\Pipes\FixPrettyJsonPipe;
|
16 | 16 | use Guanguans\LaravelExceptionNotify\Pipes\LimitLengthPipe;
|
17 | 17 | use Guanguans\LaravelExceptionNotify\Pipes\SprintfHtmlPipe;
|
| 18 | +use Guanguans\LaravelExceptionNotify\Pipes\SprintfMarkdownPipe; |
18 | 19 | use Guanguans\LaravelExceptionNotify\ReportUsingCreator;
|
19 | 20 |
|
20 | 21 | return [
|
|
79 | 80 | Guanguans\LaravelExceptionNotify\Collectors\ExceptionContextCollector::class,
|
80 | 81 | Guanguans\LaravelExceptionNotify\Collectors\ExceptionTraceCollector::class,
|
81 | 82 | Guanguans\LaravelExceptionNotify\Collectors\RequestBasicCollector::class,
|
82 |
| - Guanguans\LaravelExceptionNotify\Collectors\RequestHeaderCollector::class, |
83 |
| - Guanguans\LaravelExceptionNotify\Collectors\RequestQueryCollector::class, |
84 |
| - Guanguans\LaravelExceptionNotify\Collectors\RequestPostCollector::class, |
85 |
| - Guanguans\LaravelExceptionNotify\Collectors\RequestRawFileCollector::class, |
86 |
| - Guanguans\LaravelExceptionNotify\Collectors\RequestFileCollector::class, |
| 83 | + // Guanguans\LaravelExceptionNotify\Collectors\RequestHeaderCollector::class, |
| 84 | + // Guanguans\LaravelExceptionNotify\Collectors\RequestQueryCollector::class, |
| 85 | + // Guanguans\LaravelExceptionNotify\Collectors\RequestPostCollector::class, |
| 86 | + // Guanguans\LaravelExceptionNotify\Collectors\RequestRawFileCollector::class, |
| 87 | + // Guanguans\LaravelExceptionNotify\Collectors\RequestFileCollector::class, |
87 | 88 | // \Guanguans\LaravelExceptionNotify\Collectors\RequestMiddlewareCollector::class,
|
88 | 89 | // \Guanguans\LaravelExceptionNotify\Collectors\RequestServerCollector::class,
|
89 | 90 | // \Guanguans\LaravelExceptionNotify\Collectors\RequestCookieCollector::class,
|
|
101 | 102 | * The list of channels.
|
102 | 103 | */
|
103 | 104 | 'channels' => [
|
| 105 | + /** |
| 106 | + * Log. |
| 107 | + * |
| 108 | + * @see \Illuminate\Support\Facades\Log |
| 109 | + * @see \Illuminate\Log\LogManager |
| 110 | + */ |
| 111 | + 'log' => [ |
| 112 | + 'driver' => 'log', |
| 113 | + 'channel' => 'daily', |
| 114 | + ], |
| 115 | + |
| 116 | + /** |
| 117 | + * Mail. |
| 118 | + * |
| 119 | + * @see \Illuminate\Support\Facades\Mail |
| 120 | + * @see \Illuminate\Mail\MailManager |
| 121 | + */ |
| 122 | + 'mail' => [ |
| 123 | + 'mailer' => null, |
| 124 | + 'to' => env( 'EXCEPTION_NOTIFY_MAIL_TO', '[email protected]'), |
| 125 | + 'pipes' => [ |
| 126 | + SprintfHtmlPipe::class, |
| 127 | + ], |
| 128 | + ], |
| 129 | + |
| 130 | + /** |
| 131 | + * Bark. |
| 132 | + * |
| 133 | + * @see https://github.com/guanguans/notify#platform-support |
| 134 | + */ |
| 135 | + 'bark' => [ |
| 136 | + 'driver' => 'notify', |
| 137 | + 'authenticator' => [ |
| 138 | + 'class' => \Guanguans\Notify\Bark\Authenticator::class, |
| 139 | + 'token' => env('EXCEPTION_NOTIFY_BARK_TOKEN'), |
| 140 | + ], |
| 141 | + 'client' => [ |
| 142 | + 'class' => \Guanguans\Notify\Bark\Client::class, |
| 143 | + 'http_options' => [], |
| 144 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 145 | + ], |
| 146 | + 'message' => [ |
| 147 | + 'class' => \Guanguans\Notify\Bark\Messages\Message::class, |
| 148 | + 'title' => '{title}', |
| 149 | + 'body' => '{report}', |
| 150 | + ], |
| 151 | + 'pipes' => [ |
| 152 | + FixPrettyJsonPipe::class, |
| 153 | + hydrate_pipe(LimitLengthPipe::class, 1024), |
| 154 | + ], |
| 155 | + ], |
| 156 | + |
| 157 | + /** |
| 158 | + * Chanify. |
| 159 | + * |
| 160 | + * @see https://github.com/guanguans/notify#platform-support |
| 161 | + */ |
| 162 | + 'chanify' => [ |
| 163 | + 'driver' => 'notify', |
| 164 | + 'authenticator' => [ |
| 165 | + 'class' => \Guanguans\Notify\Chanify\Authenticator::class, |
| 166 | + 'token' => env('EXCEPTION_NOTIFY_CHANIFY_TOKEN'), |
| 167 | + ], |
| 168 | + 'client' => [ |
| 169 | + 'class' => \Guanguans\Notify\Chanify\Client::class, |
| 170 | + 'http_options' => [], |
| 171 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 172 | + ], |
| 173 | + 'message' => [ |
| 174 | + 'class' => \Guanguans\Notify\Chanify\Messages\TextMessage::class, |
| 175 | + 'title' => '{title}', |
| 176 | + 'text' => '{report}', |
| 177 | + ], |
| 178 | + 'pipes' => [ |
| 179 | + FixPrettyJsonPipe::class, |
| 180 | + hydrate_pipe(LimitLengthPipe::class, 1024), |
| 181 | + ], |
| 182 | + ], |
| 183 | + |
| 184 | + /** |
| 185 | + * DingTalk. |
| 186 | + * |
| 187 | + * @see https://github.com/guanguans/notify#platform-support |
| 188 | + */ |
| 189 | + 'dingTalk' => [ |
| 190 | + 'driver' => 'notify', |
| 191 | + 'authenticator' => [ |
| 192 | + 'class' => \Guanguans\Notify\DingTalk\Authenticator::class, |
| 193 | + 'token' => env('EXCEPTION_NOTIFY_DINGTALK_TOKEN'), |
| 194 | + 'secret' => env('EXCEPTION_NOTIFY_DINGTALK_SECRET'), |
| 195 | + ], |
| 196 | + 'client' => [ |
| 197 | + 'class' => \Guanguans\Notify\DingTalk\Client::class, |
| 198 | + 'http_options' => [], |
| 199 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 200 | + ], |
| 201 | + 'message' => [ |
| 202 | + 'class' => \Guanguans\Notify\DingTalk\Messages\MarkdownMessage::class, |
| 203 | + 'title' => '{title}', |
| 204 | + 'text' => '{report}', |
| 205 | + ], |
| 206 | + 'pipes' => [ |
| 207 | + hydrate_pipe(AddKeywordPipe::class, env('EXCEPTION_NOTIFY_DINGTALK_KEYWORD')), |
| 208 | + FixPrettyJsonPipe::class, |
| 209 | + hydrate_pipe(LimitLengthPipe::class, 20000), |
| 210 | + ], |
| 211 | + ], |
| 212 | + |
| 213 | + /** |
| 214 | + * Discord. |
| 215 | + * |
| 216 | + * @see https://github.com/guanguans/notify#platform-support |
| 217 | + */ |
| 218 | + 'discord' => [ |
| 219 | + 'driver' => 'notify', |
| 220 | + 'authenticator' => [ |
| 221 | + 'class' => \Guanguans\Notify\Discord\Authenticator::class, |
| 222 | + 'webHook' => env('EXCEPTION_NOTIFY_DISCORD_WEBHOOK'), |
| 223 | + ], |
| 224 | + 'client' => [ |
| 225 | + 'class' => \Guanguans\Notify\Discord\Client::class, |
| 226 | + 'http_options' => [], |
| 227 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 228 | + ], |
| 229 | + 'message' => [ |
| 230 | + 'class' => \Guanguans\Notify\Discord\Messages\Message::class, |
| 231 | + 'content' => '{report}', |
| 232 | + ], |
| 233 | + 'pipes' => [ |
| 234 | + FixPrettyJsonPipe::class, |
| 235 | + hydrate_pipe(LimitLengthPipe::class, 2000), |
| 236 | + ], |
| 237 | + ], |
| 238 | + |
104 | 239 | /**
|
105 | 240 | * Lark.
|
| 241 | + * |
| 242 | + * @see https://github.com/guanguans/notify#platform-support |
106 | 243 | */
|
107 | 244 | 'lark' => [
|
108 | 245 | 'driver' => 'notify',
|
109 | 246 | 'authenticator' => [
|
110 | 247 | 'class' => \Guanguans\Notify\Lark\Authenticator::class,
|
111 |
| - 'token' => '...', |
112 |
| - 'secret' => '...', |
| 248 | + 'token' => env('EXCEPTION_NOTIFY_LARK_TOKEN'), |
| 249 | + 'secret' => env('EXCEPTION_NOTIFY_LARK_SECRET'), |
113 | 250 | ],
|
114 | 251 | 'client' => [
|
115 | 252 | 'class' => \Guanguans\Notify\Lark\Client::class,
|
|
121 | 258 | 'text' => '{report}',
|
122 | 259 | ],
|
123 | 260 | 'pipes' => [
|
124 |
| - hydrate_pipe(AddKeywordPipe::class, 'keyword'), |
| 261 | + hydrate_pipe(AddKeywordPipe::class, env('EXCEPTION_NOTIFY_LARK_KEYWORD')), |
125 | 262 | FixPrettyJsonPipe::class,
|
126 | 263 | hydrate_pipe(LimitLengthPipe::class, 30720),
|
127 | 264 | ],
|
128 | 265 | ],
|
129 | 266 |
|
130 | 267 | /**
|
131 |
| - * Mail. |
| 268 | + * Ntfy. |
132 | 269 | *
|
133 |
| - * @see Illuminate\Mail\MailManager |
| 270 | + * @see https://github.com/guanguans/notify#platform-support |
134 | 271 | */
|
135 |
| - 'mail' => [ |
136 |
| - 'mailer' => null, |
137 |
| - |
| 272 | + 'ntfy' => [ |
| 273 | + 'driver' => 'notify', |
| 274 | + 'authenticator' => [ |
| 275 | + 'class' => \Guanguans\Notify\Ntfy\Authenticator::class, |
| 276 | + 'usernameOrToken' => env('EXCEPTION_NOTIFY_NTFY_USERNAMEORTOKEN'), |
| 277 | + 'password' => env('EXCEPTION_NOTIFY_NTFY_PASSWORD'), |
| 278 | + ], |
| 279 | + 'client' => [ |
| 280 | + 'class' => \Guanguans\Notify\Ntfy\Client::class, |
| 281 | + 'http_options' => [], |
| 282 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 283 | + ], |
| 284 | + 'message' => [ |
| 285 | + 'class' => \Guanguans\Notify\Ntfy\Messages\Message::class, |
| 286 | + 'topic' => env('EXCEPTION_NOTIFY_NTFY_TOPIC', 'laravel-exception-notify'), |
| 287 | + 'title' => '{title}', |
| 288 | + 'message' => '{report}', |
| 289 | + ], |
138 | 290 | 'pipes' => [
|
139 |
| - SprintfHtmlPipe::class, |
| 291 | + // FixPrettyJsonPipe::class, |
| 292 | + // hydrate_pipe(LimitLengthPipe::class, 30720), |
140 | 293 | ],
|
141 | 294 | ],
|
142 | 295 |
|
143 | 296 | /**
|
144 |
| - * Log. |
| 297 | + * Slack. |
145 | 298 | *
|
146 |
| - * @see Illuminate\Log\LogManager |
| 299 | + * @see https://github.com/guanguans/notify#platform-support |
147 | 300 | */
|
148 |
| - 'log' => [ |
149 |
| - 'driver' => 'log', |
150 |
| - 'channel' => 'daily', |
151 |
| - 'pipes' => [], |
| 301 | + 'slack' => [ |
| 302 | + 'driver' => 'notify', |
| 303 | + 'authenticator' => [ |
| 304 | + 'class' => \Guanguans\Notify\Slack\Authenticator::class, |
| 305 | + 'webHook' => env('EXCEPTION_NOTIFY_SLACK_WEBHOOK'), |
| 306 | + ], |
| 307 | + 'client' => [ |
| 308 | + 'class' => \Guanguans\Notify\Slack\Client::class, |
| 309 | + 'http_options' => [], |
| 310 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 311 | + ], |
| 312 | + 'message' => [ |
| 313 | + 'class' => \Guanguans\Notify\Slack\Messages\Message::class, |
| 314 | + 'text' => '{report}', |
| 315 | + ], |
| 316 | + 'pipes' => [ |
| 317 | + SprintfMarkdownPipe::class, |
| 318 | + // FixPrettyJsonPipe::class, |
| 319 | + // hydrate_pipe(LimitLengthPipe::class, 30720), |
| 320 | + ], |
| 321 | + ], |
| 322 | + |
| 323 | + /** |
| 324 | + * Telegram. |
| 325 | + * |
| 326 | + * @see https://github.com/guanguans/notify#platform-support |
| 327 | + */ |
| 328 | + 'telegram' => [ |
| 329 | + 'driver' => 'notify', |
| 330 | + 'authenticator' => [ |
| 331 | + 'class' => \Guanguans\Notify\Telegram\Authenticator::class, |
| 332 | + 'token' => env('EXCEPTION_NOTIFY_TELEGRAM_TOKEN'), |
| 333 | + ], |
| 334 | + 'client' => [ |
| 335 | + 'class' => \Guanguans\Notify\Telegram\Client::class, |
| 336 | + 'http_options' => [], |
| 337 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 338 | + ], |
| 339 | + 'message' => [ |
| 340 | + 'class' => \Guanguans\Notify\Telegram\Messages\TextMessage::class, |
| 341 | + 'chat_id' => env('EXCEPTION_NOTIFY_TELEGRAM_CHAT_ID'), |
| 342 | + 'text' => '{report}', |
| 343 | + ], |
| 344 | + 'pipes' => [ |
| 345 | + FixPrettyJsonPipe::class, |
| 346 | + hydrate_pipe(LimitLengthPipe::class, 4096), |
| 347 | + ], |
| 348 | + ], |
| 349 | + |
| 350 | + /** |
| 351 | + * WeWork. |
| 352 | + * |
| 353 | + * @see https://github.com/guanguans/notify#platform-support |
| 354 | + */ |
| 355 | + 'weWork' => [ |
| 356 | + 'driver' => 'notify', |
| 357 | + 'authenticator' => [ |
| 358 | + 'class' => \Guanguans\Notify\WeWork\Authenticator::class, |
| 359 | + 'token' => env('EXCEPTION_NOTIFY_WEWORK_TOKEN'), |
| 360 | + ], |
| 361 | + 'client' => [ |
| 362 | + 'class' => \Guanguans\Notify\WeWork\Client::class, |
| 363 | + 'http_options' => [], |
| 364 | + // 'tapper' => \Guanguans\LaravelExceptionNotify\DefaultClientTapper::class, |
| 365 | + ], |
| 366 | + 'message' => [ |
| 367 | + 'class' => \Guanguans\Notify\WeWork\Messages\MarkdownMessage::class, |
| 368 | + 'content' => '{report}', |
| 369 | + ], |
| 370 | + 'pipes' => [ |
| 371 | + FixPrettyJsonPipe::class, |
| 372 | + hydrate_pipe(LimitLengthPipe::class, 5120), |
| 373 | + ], |
152 | 374 | ],
|
153 | 375 | ],
|
154 | 376 | ];
|
0 commit comments