Download the PHP package yii1tech/psr-log without Composer

On this page you can find all versions of the php package yii1tech/psr-log. 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 psr-log

Yii1 PSR Log Extension


This extension allows integration with PSR compatible logger for Yii1. Its usage in particular it allows usage of Monolog logger.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the "require" section of your composer.json.

Usage

This extension allows integration with PSR compatible logger for Yii1. It provides several instruments for that. Please choose the one suitable for your particular needs.

Wrap PSR logger into Yii logger

The most common use case for PSR logger involvement into Yii application is usage of 3rd party log library like Monolog. This can be achieved using \yii1tech\psr\log\Logger instance as Yii logger. Its instance should be passed to \Yii::setLogger() before the application instantiation.

Application entry script example:

\yii1tech\psr\log\Logger passes all messages logged via Yii::log() to the related PSR logger, which stores them according to its own internal logic.

Also, usage of \yii1tech\psr\log\Logger grands you several additional benefits:

For example:

You may also specify a global log context, which should be written with every message. For example:

PSR Log Route

It is not necessary to \yii1tech\psr\log\Logger if you need to pass logs to PSR logger. As an alternative you can add \yii1tech\psr\log\PsrLogRoute log route to the standard Yii "log" component.

Application configuration example:

Note: even if you use \yii1tech\psr\log\Logger as Yii logger, this \yii1tech\psr\log\PsrLogRoute will be unable to handle passed log context correctly.

Wrap Yii logger into PSR logger

There is another use case related to PSR logger besides bootstrapping eternal log storage. Sometimes 3rd party libraries may require PSR logger instance to be passed to them in order to function. For example, imagine we have a 3rd party library for "daemon" application running:

You can use \yii1tech\psr\log\PsrLogger to wrap standard Yii logging mechanism into PSR interface.

Application configuration example:

Now while working with our example external "daemon" application, we can use following code:

Note: in order to handle log context properly \yii1tech\psr\log\PsrLogger should be used in junction with \yii1tech\psr\log\Logger.


All versions of psr-log with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
yiisoft/yii Version ~1.1.0
psr/log Version >=1.0.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 yii1tech/psr-log contains the following files

Loading the files please wait ....