Download the PHP package unifreak/qlog without Composer

On this page you can find all versions of the php package unifreak/qlog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package qlog

中文用户请见 https://github.com/UniFreak/QLog/blob/master/README.cn.md

QLog wraps around Monolog package, and added some customized Handlers/Processors/Formatters, to provide these features:

For now, two main use case of QLog are:

Installation

Simply run composer require unifreak/qlog

Usage

Some Concepts

QLog logs records as an array with a pre-defined structure, like this:

Initialisation

QLog's constructor requires two parameter: a \Predis\Client/\Reids instance, and a config array. Like this:

Config options: $config

Log

You can log different level record by calling different log methods, passing in log message (required) and log context (optional):

Specify Channels

You can specify pre-defined channels by calling these methods:

Also, you can specify a customized channel by calling in() method:

Specify ID

You can specify multiple id name/value pairs by calling idBy() method. NOTE: id name must end with _id.

Then the record will have additional two id fields:

NOTE:

Filter Stashed Logs

You can filter stashed logs by calling these methods:

NOTE: if QLog is configured not to log into stash zone (the log_to config option), then stash zone will be empty, hence all above methods will return a empty array

Laravel & Lumen

QLog provides a facade class and service provider class for laravel/lumen:

After registering facade and service provider, you can use QLog to access QLogger, like:

The QLogServiceProvider also enables auto logging sql queries and GuzzleHttp requests. You can use the following query parameters to control QLog's log bahaviors:

  1. qlog_debug:

    A none-zero value is equivalent to pass in qlog_autolog=2 and qlog_log_to=0, enable auto logging both GuzzleHttp request and sql queries, and only log into stash zone. see below

  2. qlog_autolog: control auto log behaviors

    • 1: Default. Auto log GuzzleHttp requests
    • 2: Auto log both GuzzleHttp requests and sql queries
  3. qlog_log_to: control log zone

    • 0: Only log into stash zone
    • 1: Only log into redis queue
    • 2: Log both into stash zone and redis queue

Register Facade and Service Provider

  1. Add a new config file config/qlog.php:

  2. Add the following codes into bootstrap/app.php:

NOTE: Make sure that service provider is registered after $app->withEloquent() , otherwise the sql queries auto logging feature will not function properly

See laravel/lumen official documentation for more infomation

TODO


All versions of qlog with dependencies

PHP Build Version
Package Version
Requires monolog/monolog Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package unifreak/qlog contains the following files

Loading the files please wait ....