Download the PHP package sesser/slogger without Composer

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

Sesser\Slogger

Build Status

This is a basic logging utility. It supports a file based logger and a MongoDB based logger. Each log provider has different settings which I'll go over below. The way this util is set up should make it easy to implement whatever provider your project requires (another database, a different NoSQL store, a web service, etc).

Features & Goodies

Sesser\Slogger\Providers\File

The File provider is pretty basic. It supports a few configuration options as described below:

The default config looks like this:

Most of those are pretty self explanatory. You'll notice that it defaults to ISlogger::LEVEL_ERROR and is disabled. The logfile setting is the path to the actual log file. The logging util is built as a singleton but you can create multipe file loggers by specifying a different logfile when you call Slogger::Get('MyLogger')

The serializer setting is there to provide you with your own serializer for the objects that you log. By default, if you pass anything other than a string, Slogger uses print_r($obj, true). This setting must be callable (via is_callable()) or it won't work.

Setting up a simple File logger

Here's how to doit...

If you want to get the same logger in another class, you don't have to pass all the same settings when you called it the first time. Just pass the logfile setting and Logger will find the correct logger you're looking for.

If you want to change the way the logger is configured (say you want to programmatically turn on debug or disable logging altogether), simply call configure with your updated configuration array and it willl automatically pickup the changes the next time you call $log = Slogger::Get('MyLogger');

Sesser\Slogger\Providers\Mongodb

NB: This hasn't been implemented yet. But will be shortly.

The Mongodb provider was born out of curiosity more than any need. I first thought about a regular DB (like MySQL) but I'm not sure anyone wants their app bound to database writes when things go south and app starts logging errors all frantic like because of an edge case. Anyway, the configuration for the Mongo provider is a little different but does share some similar settings.

The name setting here is kinda like the logfile setting in the File logger. It provides a unique identifier for a particular logger (e.g. you can have multiple loggers in one app). The server config array is basic all what gets passed to the Mongo constructor so make sure these settings are correct. The server -> options array is optional but there if you need it. If you need to override any of the defaults (or add your own), just pass in an empty array for the options (or add keys that you need).

Other tid-bits

This project as some test cases and all the ones I've written pass. That doesn't mean it's inclusive of all scenarios and use-cases. If you find a particular use-case, please either update the tests or file an issue here on GitHub.

This project also uses the new(er) ApiGen. To generate the API docs, simply navigate to the src directory in a terminal and type apigen. This assumes you have ApiGen installed correctly and that apigen is in your path.


All versions of slogger with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 sesser/slogger contains the following files

Loading the files please wait ....