Giter Club home page Giter Club logo

laravel-loki-logging's Introduction

Laravel Loki Logging

Logging to Loki for Laravel
Fork https://github.com/rdemorais/laravel-loki-logging

Usage

  1. Install this package: composer require elgibor-solution/laravel-loki-logging
  2. Publish the configuration: php artisan vendor:publish --provider=ESolution\\LaravelLokiLogging\\L3ServiceProvider
  3. Create a new log channel in config/logging.php:
    'loki' => [
      'driver' => 'monolog',
      'handler' => L3Logger::class,
    ]
  4. Configure at least the LOG_CHANNEL, LOG_USERNAME and LOG_PASSWORD
    1. Ensure APP_NAME is configured appropriately. If this value cannot be changed, use LOG_APP.
    2. Optionally configure LOG_SERVER and LOG_FORMAT
  5. Configure the loki:persist job to run periodically in your schedule. We recommend every minute, but feel free to reduce this.
  6. Log::info('Hello Loki!');

Configuration

The behaviour of the logger can be adjusted with the config options below.

Key Description Default
context Extra variables to be added as labels to the message. Variable substitutions are available. application: env('LOG_APPLICATION')
type: '{level_name}'
format How log messages should be formatted. Variable substitutions are available. [{level_name}] {message}
loki.server The loki server to which data should be logged. https://<url>/loki
loki.username Username for HTTP basic authentication, can be left empty. Env-variable LOG_USERNAME
loki.password Password for HTTP basic authentication, can be left empty. Env-variable LOG_PASSWORD

laravel-loki-logging's People

Contributors

cerebralfart avatar devig avatar janblahawebsta avatar korridor avatar rdemorais 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.