Download the PHP package popphp/pop-log without Composer

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

pop-log

Build Status Coverage Status

Join the chat at https://discord.gg/TZjgT74U7E

Overview

pop-log is a logging component that provides a way of logging events following the standard BSD syslog protocol outlined in RFC-3164. Support is built-in for writing log messages to a file or database table or deploying them via email or HTTP. The eight available log message severity values are:

and are available via their respective methods:

pop-log is a component of the Pop PHP Framework.

Top

Install

Install pop-log using Composer.

composer require popphp/pop-log

Or, require it in your composer.json file

"require": {
    "popphp/pop-log" : "^4.0.2"
}

Top

Quickstart

This is a basic example using the file writer:

Then, your 'app.log' file will contain:

Top

Writers

There are four available log writers, but others can be created if they implement the Pop\Log\Writer\WriterInterface.

File

The file log writer simply stores the log output to a log file on disk. The log file format is derived from the log filename. Supported log file types include:

The above code creates a CSV file with the log entry:

Top

Mail

The mail log writer sends the log entries via email using the popphp/pop-mail component. The constructor requires a Pop\Mail\Mailer object and at least one email as the second argument. An optional third argument allows you to pass in additional email headers, like a subject and CC addresses.

Then the emails listed above will receive a series of emails like this:

Top

Database

Writing a log to a table in a database requires the popphp/pop-db component. The database writer constructor takes an instance of Pop\Db\Adapter\AbstractAdapter and also an optional $table argument (the default table name is pop_log).

In this case, the logs are written to a database table that has the columns id, timestamp, level, name and message. So, after the example above, your database table would look like this:

Id Timestamp Level Name Message
1 2015-07-11 12:32:32 6 INFO Just a info message
2 2015-07-11 12:32:33 1 ALERT Look Out! Something serious happened!

Top

HTTP

Using the HTTP writer requires the pop-http component. It creates a request and sends it to the HTTP logging resource. (Refer to the pop-http documentation for more information on how to use the HTTP client.)

The log writer will send HTTP requests with the log data to the HTTP service with the following HTTP data fields:

Top

Context

For additional contextual information, the $context array can be passed to the methods called to trigger the log entry. It can contain:

Top

Limits

Log level limits can be set for the log writer objects to enforce the severity of which log messages actually get logged:

The app_prod.log file will contain:

And the app_dev.log file will contain:


All versions of pop-log with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 popphp/pop-log contains the following files

Loading the files please wait ....