Download the PHP package originphp/log without Composer

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

Log

license build coverage

There are 4 built in Log Engines, and it is easy to implement your own. You can use the Log static class or PSR-3 Logger class.

Installation

To install this package

First you need to configure the Log library, in your application bootstrap or configuration.

Then to log

This will produce something like this in /var/www/logs/application.log.

Channels

To group your log messages, set a channel name.

This will create a log entry like this

Placeholders

You can also use placeholders in the message.

Adding data to messages

After placeholders any have been replaced, any remaining data will be converted to a JSON string.

Which will output like this

Log Levels

Log works with all the different levels as defined in the RFC 5424 specifications.

Configuration

You can use a single engine or multiple engines at once, and you can also customize which levels to Log on.

File Engine

To configure the file engine logging

Options for the File Engine are:

Email Engine

To configure email logging

Options for the Email Engine are:

You should always test your email configuration first, if an exception occurs when trying to send the email, it is caught and is not logged to prevent recursion.

Console Engine

To configure the Console Engine

Options for the Console Engine are:

Syslog Engine

You should use the Syslog engine on your production server. To configure the Syslog engine.

Options for the Syslog Engine are:

You can also pass settings to the openlog command, these are identity,option,facility, see openlog for more information on what these do.

Example

Lets say you want to configure the logger to log all events in a file as normal, send critical log entires by email and create a separate log for just payments.

Creating a Custom Log Engine

To create a custom Log Engine, create the folder structure app/Log/Engine, and create an engine class with the method log.

Then in your bootstrap configuration

PSR-3 Logger

The Log library uses a PSR-3 Logger that you may want to use instead of the static Log class.

When you create the Logger instance you can pass a single engine configuration, which is common when just starting on a new app.

To change the settings for an engine, or add additional engines or configurations of engines


All versions of log with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
originphp/configurable Version ^2.0.0
originphp/email Version ^2.0
psr/log Version ^1.0.1 || ^2.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 originphp/log contains the following files

Loading the files please wait ....