Giter Club home page Giter Club logo

laralog's Introduction

LARALOG

PHP Laravel package to debug and handle logs via telegram bot

License Packagist Version Packagist Version

Requirements

Installation

Install the package via composer

composer require milly/laralog

Publish the configuration file

 php artisan vendor:publish --tag=laralog-config

Add the following environment variables to your .env file or set them in the config/laralog.php file

TELEGRAM_BOT_TOKEN=1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ
TELEGRAM_CHAT_ID=-1234567890

Methods

The package provides the following methods to send log messages to the telegram bot

  • Laralog::debug(int|string|array|object $message)
  • Laralog::info(int|string|array|object $message)
  • Laralog::warning(int|string|array|object $message)
  • Laralog::error(int|string|array|object $message)

Usage

Send a log message to the telegram bot

use Milly\Laralog\Laralog;

// call statically
Laralog::debug('This is a debug message');

//call instance
$laralog = new Laralog();
$laralog->info('This is an info message');

And you will receive a message in your telegram bot with the debug message like this:

Development mode

By default, the package is in the development mode, which means that it will send messages only if the APP_ENV is set to local. If you want to send messages in the production mode, you need to set the is_enabled key to true in the config/laralog.php file

return [
    'is_enabled' => true,
    'telegram_bot_token' => env('TELEGRAM_BOT_TOKEN'),
    'telegram_chat_id' => env('TELEGRAM_CHAT_ID'),
];

License

This package is open-sourced software licensed under the MIT license.

laralog's People

Contributors

mirmuxsin avatar

Stargazers

Muhammaddiyor Tohirov avatar  avatar Samandar Murodjonov avatar

Watchers

 avatar

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.