Giter VIP home page Giter VIP logo

laravel-telegram-logging's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-telegram-logging's Issues

Logging not working after updating to v1.8

laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (Error(code: 0): Class \"Logger\\TelegramHandler\" not found at /vendor/grkamil/laravel-telegram-logging/src/TelegramLogger.php:24)
[stacktrace]
#0 /vendor/laravel/framework/src/Illuminate/Log/LogManager.php(247): Logger\\TelegramLogger->__invoke()
#1 /vendor/laravel/framework/src/Illuminate/Log/LogManager.php(220): Illuminate\\Log\\LogManager->createCustomDriver()
#2 /vendor/laravel/framework/src/Illuminate/Log/LogManager.php(135): Illuminate\\Log\\LogManager->resolve()
#3 /vendor/laravel/framework/src/Illuminate/Log/LogManager.php(122): Illuminate\\Log\\LogManager->get()
#4 /vendor/laravel/framework/src/Illuminate/Log/LogManager.php(645): Illuminate\\Log\\LogManager->driver()
#5 /vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(274): Illuminate\\Log\\LogManager->error()
#6 /vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(182): Illuminate\\Foundation\\Exceptions\\Handler->report()
#7 /vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(226): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleException()
#8 /vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(250): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleShutdown()
#9 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#10 {main}
"} 
laravel.ERROR: Declaration of Logger\TelegramHandler::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void {"userId":1,"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Declaration of Logger\\TelegramHandler::write(array $record): void must be compatible with Monolog\\Handler\\AbstractProcessingHandler::write(Monolog\\LogRecord $record): void at /vendor/grkamil/laravel-telegram-logging/src/TelegramHandler.php:75)
[stacktrace]
#0 {main}
"} 

Feature request: prevent to send duplicate errors

Problem:
When external services are down, I continuously receive messages about it, several messages per second.

Solution:
Make a setting for limiting the number of identical messages per unit of time.

I can do this and offer a pull-request. I think this can be done using the Cache facade. But I'm not sure if this is the best way. If there are other options, tell me and I will make a pull request.

How add proxy?

I can send to telegram only through a proxy. How add proxy?

composer doesn't allow to require this package with laravel 5.8

Problem 1
- Installation request for grkamil/laravel-telegram-logging ^0.1.2 -> satisfiable by grkamil/laravel-telegram-logging[0.1.2].
- Conclusion: remove laravel/framework v5.8.28
- Conclusion: don't install laravel/framework v5.8.28
- grkamil/laravel-telegram-logging 0.1.2 requires laravel/framework 5.6.|5.7. -> satisfiable by laravel/framework[5.6.x-dev, 5.7.x-dev].
- Can only install one of: laravel/framework[5.6.x-dev, v5.8.28].
- Can only install one of: laravel/framework[5.7.x-dev, v5.8.28].
- Installation request for laravel/framework (locked at v5.8.28, required as 5.8.*) -> satisfiable by laravel/framework[v5.8.28].

Too long message for telegram to proccess

Hello, thanks for a great package!

I ran into an issue recently, where Telegram is failing to send a long error message with huge mysql query error.

And Telegram returned "HTTP request failed! HTTP/1.1 400 Bad Request".

It works with shorter message though.

Would you like me to find out the limit and send a pull request to substr the message?

Allow to set different chat id (Or bot id too)

I don't know if it's possible, but It would be great something like:

Log::channel('telegram')->setBotId('example')->setChatId('example')->info('Log!');

To log with its credentials without override the config credentials

Template issues in Laravel 11

I'm migrating my app to Laravel 11 and have issue with templates. I use the minimal template where I only display the message ie. {{ formatted }}, but for some reason the app name with the log type is also sent as a message to Telegram. Any ideas what could be the issue? Seems like the published template is not being used.

All template wrap tag and length more 4096

If error message length over 4096 and i change template:

<b>{{ $appName }}</b> ({{ $level_name }})
Env: {{ $appEnv }}
<pre>[{{ $datetime->format('Y-m-d H:i:s') }}] {{ $appEnv }}.{{ $level_name }} {{ $formatted }}</pre>

Message break and I get two messages:

<b>Project</b> (ERROR)
Env: local
<pre>[2023-03-01 17:41:32] local.ERROR many text

and:

many text</pre>

When send messages to telegram as a response we get 400 error:

{
  "ok": false,
  "error_code": 400,
  "description": "Bad Request: can't parse entities: Can't find end tag corresponding to start tag pre"
}

If not use wrap tag everything is fine.

Addition

I want 1 error = 1 message even if the size is over 4096. Example cut off and add ...

<b>Project</b> (ERROR)
Env: local
[2023-03-01 17:41:32] local.ERROR bla-bla-bla ...

Logs not working in production

I'm sure my problem doesn't come from this package but I ran out of solution.

When I log a simple string Log::info('test'); it works perfectly in local.

But in production server (VPS), it does not. I don't know why. I checked everything. The logs are being written correctly in the logs. But when I set the LOG_CHANNEL to telegram, nothing happens. I tried putting "telegram" in the stack array. Nothing. Any idea ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.