Download the PHP package carlosafonso/logga without Composer

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

logga

Latest Stable Version Build Status Total Downloads License

Logga is a logging library for PHP designed for simplicity and ease of use. Starting from v1.0.0, Logga features support for multiple logging streams and message formatters, providing developers with great flexibility.

Current version features a file stream and a default formatter. Future releases of Logga will have a Database stream out of the box, as well as a plugin system to allow developers to write custom streams and formatters so that pretty much every logging need is covered.

Installation

Composer

Since version 2.0.0 Logga can be installed using Composer. Add the following dependency to your composer.json:

Then run:

Don't forget to include Composer's autoload file if you haven't done so already:

Manual installation

Logga can also be installed by downloading the latest version and unzipping everything into your project folder, or by cloning the repository:

Remember to include the main library file into your project:

Quick start

Set up a quick logger with the following code:

If you run this code, the following line will be printed on screen:

Furthermore, a file named something like default_log.log will appear in the folder you're running your script from. A quick look into it reveals the same content shown above.

And that's pretty much it! You have set up your logging system with just a couple of lines. From now on you can trace everything you need using any of the eight logging functions provided by Logga (debug(), info(), notice(), warning(), error(), critical(), alert() and emergency()).

Usage

The above is simple enough for the average developer but you might want to customize Logga a bit in order to fulfill your needs. This section will show you how.

Understanding streams

In Logga, as in other logging libraries, a stream is an abstraction of a place where log messages are stored. You can use as many streams as you need, so that logging a message just once produces the same output in different places (i.e., a plain text file and a database table).

Additionally, you can configure each stream: for example, you might want all messages to be logged to the plain text file but only WARNING messages or above into the database.

As of version 2.2.0, Logga comes with 4 streams: FileStream, HttpStream, MailStream and StandardOutputStream (with several others currently in the works, such as DatabaseStream).

Default streams

If you don't specifically provide any stream to Logga's constructor, the library will use both a FileStream and a StandardOutputStream by default (the first one logging to a file named default_log.log).

Creating a custom stream

You can create a stream by instantiating any class which extends from LogStream, optionally passing an array with the desired options:

The above will produce a file called my_custom_log_file_<datetime>.log, where datetime is the current date and time.

You can use more than one stream. Just call Logga's constructor with an array of streams:

Streams

Specifying a log level

###Enabling and disabling streams ###Available stream classes ##Formatters

All versions of logga 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 carlosafonso/logga contains the following files

Loading the files please wait ....