Download the PHP package jkachel/codeigniter-monolog-plus without Composer

On this page you can find all versions of the php package jkachel/codeigniter-monolog-plus. 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 codeigniter-monolog-plus

Codeigniter-Monolog-Plus V2

This is a fork and a now mostly rewrite of Codeigniter-Monolog-Plus by @JoshHighland, which itself is based on Codeigniter-Monolog by @SteveThomas.

CodeIgniter Monolog Plus brings the Monolog logging package into a CodeIgniter 3 project, replacing the built-in _CILog library and adding a bunch of configurability. Multiple loggers can be set up for various purposes, locations, and services, and individual thresholds can be set to have their own logging.

This started as a simple fork to add Loggly, PHP Console, and SyslogUdp (bare) support and ended up being a bit of a rewrite to make things more useful. It also now more closely integrates in with Composer.

Changes from Upstream

Installation

This package is now in Packagist so composer require jkachel/codeigniter-monolog-plus ought to be sufficient. If you'd rather add dev-master:

Usage

Use log_message() as normal in CodeIgniter to log error, debug and info messages. File loggers log to the files you've specified, and everything else logs as you've set it in the configuration file.

Log Levels

This library does not (yet) use the standard Monolog/RFC 5424 log levels; it still depends on the CodeIgniter defaults. They're mapped in this manner:

CI also defines an "all", which maps to DEBUG. It's the lowest level, so it's a catch-can for everything.

Configuration

The configuration file is very different from the upstream library and is not compatible.

The library structures configuration options into a single array, with three main sections:

  1. Global options - these are things that pertain to the entire library (and are mostly applied to the Monolog instance itself)
  2. Handler options - settings for each individual handler that you might want
  3. Priority list - the order in which to log things (as a base, the threshold also takes effect here)

The array itself is just a standard associative array, like such:

Note that simply having the handler in the config file is not necessarily enough to make the handler work - in most cases, you'll also need to make sure the packages are there for that given handler. (For example, if you want to use the Loggly handler, you'll need to install the Loggly package through composer.) See the Monolog documentation for details on what you'll need to install for the given handler you want to use. The exceptions here are the file-based ones and the stream/stderr one; those are part of the core Monolog package and are automatically installed.

Global Options

These go at the root of the array.

Handler Options

Each handler can have as many blocks as you require, but each one that's actually being used should have a default block. The library will look for a default block if it can't find a named one or if you specify the handler without a block name. The handlers themselves are:

The blocks are another associative array. They all must have these two keys:

Outside of that, each handler has its own set of options.

file / ci_file

These two use the same Monolog handler, so they have the same options.

syslogudp

new_relic

hipchat

papertrail

gelf

loggly

phpconsole

If you're using phpconsole, you do need to set up a block for the enable and threshold options, but at present this library does not expose any other options.

Priority

Priority is simply a list of handlers. They're in FIFO order - first one in the list gets priority. Each entry is one of two things:

If a suitable setup isn't found for the entry, it will just be skipped. It will also skip it if the block has enabled set to false.

Debug Mode/Failsafe Logging

The library has a debugging mode. This is especially useful if you're doing a lot with configuration settings or if you're adding in support for other handlers. To enable this, define "CIMONOLOGDEBUG" in your index.php file and set it to true.

There is also a failsafe for log functions if there are issues with the config file. (This functionality is used for debug mode logging as well.) The failsafe log is just another Monolog instance that's configured to write to application root/application/logs/log-failsafe.php - if you're seeing that file in there, that likely means you have something not set up right in the config file and it's confused.

A few error modes will trigger the failsafe logging to be enabled (including debug mode) but it will not trigger if there's simply nothing configured to log to: if all the config blocks are set to disabled, or if they're empty, it will set up a Monolog instance without any actual handlers in it.

Compatibility

The shim was originally written to work with CI 3. Inadvertent testing with CI 4 worked OK but no in-depth testing has been done. 4 uses its own better logging stuff, though.

License

codeigniter-monolog-plus is licensed under the MIT License - see the LICENSE file for details


All versions of codeigniter-monolog-plus with dependencies

PHP Build Version
Package Version
Requires graylog2/gelf-php Version ^1.5
monolog/monolog Version ^1.23
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 jkachel/codeigniter-monolog-plus contains the following files

Loading the files please wait ....