Download the PHP package oasis/logging without Composer

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

MLogger - logging for Oasis projects

oasis/logging provides classes and functions used to write logs.

The component can be referred to as MLog or MLogger in short.

There are a list of log handlers provided by default:

MLog adhere strictly to the PSR-3 standard and uses monolog/monolog as its underlying implementation.

Installation

Install the latest version with command below:

Basic Usage

It is easy to use MLogger withour any configuration:

Using the Logger directly

A Monolog\Logger can be used directly. This provides the freedom to integrate MLog with other PSR-3 compatible components who need logging tools.

Add Handler

Thanks to the mature community of monolog/monolog, MLog can take use of all the existing Handlers for monolog.

In addition, you can also write your own handler that implements the Monolog\Handler\HandlerInterface interface.

Adding a handler to MLog is as simple as:

Use auto-rotated-timestamp for file handler

The Oasis\Mlib\Logging\LocalFileHandler can be easily configured to rotate its filename based on time changes. This is a very useful feature if your script is a longlive script which runs more than just a few seconds. Provided the correct name pattern, the local filename will rotate each time the preset interval has passed. Here is an example:

The supported name patterns are:

pattern meaning
%date% substituted by date of now, in the format: yyyymmdd
%hour% substituted by hour of now, in the format: HH (00-23)
%minute% substituted by minute of now, in the format: ii (00-59)
%second% substituted by second of now, in the format: ss (00-59)
%script% substituted by name of current script, filename only without directory names
%pid% substituted by current process ID

Using AWS SNS to auto handle alert

The Oasis\Mlib\Logging\AwsSnsHandler provides a handler which is only processed when log above certain level (default to ALERT) is triggered.

It is an especially useful tool under production environment. It buffers all the logs and discard them if the script exits without error. If anything like a fatal error has put the script to exit abnormally, the handler will publish all the buffer as well as an ALERT log to the specified AWS SNS topic.

The AwsSnsHandler is an optional feature and it depends on the oasis/aws-wrappers component:

To use the AwsSnsHandler, try the code below:


All versions of logging with dependencies

PHP Build Version
Package Version
Requires monolog/monolog Version ^1.17
bramus/monolog-colored-line-formatter Version ^2.0
oasis/utils Version ^1.6
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 oasis/logging contains the following files

Loading the files please wait ....