Download the PHP package ibsciss/supermonolog-service-provider without Composer

On this page you can find all versions of the php package ibsciss/supermonolog-service-provider. 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 supermonolog-service-provider

supermonolog-service-provider

An extended monolog service provider for Silex framework

Build Status Coverage Status Latest Stable Version Latest Unstable Version License

Why a SuperMonologService ?

The silex built-in MonologServiceProvider use only a few of the monolog habilities, and don't allow advanced configuration.

This SuperMonologService is more extensible and provide two new logs strategies in the silex core :

By default only the FingersCrossed strategy is activated, but you can use the strategies together or only once at time.

What is FingerCrossed strategy ?

As described in the Monolog documentation :

FingersCrossedHandler: A very interesting wrapper. It takes a logger as parameter and will accumulate log records of all levels until a record exceeds the defined severity level. At which point it delivers all records, including those of lower severity, to the handler it wraps. This means that until an error actually happens you will not see anything in your logs, but when it happens you will have the full information, including debug and info records. This provides you with all the information you need, but only when you need it.

What is RotatingFile strategy ?

Like before, the Monolog documentation give us the answer :

RotatingFileHandler: Logs records to a file and creates one logfile per day. It will also delete files older than maxfiles. You should use logrotate for high profile setups though, this is just meant as a quick and dirty solution.

How to install it ?

  1. Add "Ibsciss/supermonolog-service-provider": "dev-master" in the require section of your composer.json file and run the composer update command.
  2. Register the service with the silex register method $app->register(new SuperMonologServiceProvider()) (don't forget the use \Ibsciss\Silex\Provider\SuperMonologServiceProvider statement).

Basic use

SuperMonolog extends the original monolog service (and the associated logger service) by overriding the monolog.handler service to push is own strategy on it. So you can use your $app['monolog'] service as before.

So you have to setup the ServiceProvide as if it was the built-in monolog service: you have to define where the log will stored by the application with the monolog.logfile attribute (read full built-in provider doc).

After the SuperMonologService registration, only the FingersCrossed strategy is activated (and only in production mode).

In debug mode ($app['debug'] = true;) the service provide a basic StreamHandler.

Note : by default a JsonFormatter is used to generate log

You can disable the FingersCrossed strategy with the monolog.fingerscrossed attribute set to false and come back to the StreamHandler used by the default MonologServiceProvider.

FingersCrossedHandler options

With SuperMonologService, the default handler use a FingersCrossed strategy to handle logs, its provide the following options :

Note : the monolog.level is still available and used to define from wich logging level the logs are handled. For example if you define the monolog.level to INFO and the monolog.fingerscrossed.level to WARNING, all log from the INFO severity level are sended if a WARNING event occur

RotatingFile strategy

You can enable RotatingFileHandler by setting the monolog.rotatingfile attribute to true.

By default the FingersCrossedHanfler` is remains active and the RotatingFileHandler is used as an internal handler called by the FingersCrossedHandler to send logs.

If the monolog.fingerscrossed is set to false and the monolog.rotatingfile to true the default handler became a RotatingFile one.

The rotatingFile strategy define the following options :


All versions of supermonolog-service-provider with dependencies

PHP Build Version
Package Version
Requires silex/silex Version ~1.0
monolog/monolog Version ~1.7
symfony/monolog-bridge Version ~2.4
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 ibsciss/supermonolog-service-provider contains the following files

Loading the files please wait ....