Download the PHP package mvf-tech/system_logger without Composer

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

SYSTEM LOGGER

A package used to perform DataDog and system logs

Releases

Installation and Setup

  1. Run composer require mvf-tech/system_logger to install the package
  2. You will also have to set DATADOG_PROJECT_NAME and DATADOG_SERVICE_NAME ENV variables

Basic Use

There are two type of reporters available, host reporters, CommandLine in the above example, and remote reporters, DataDog.histogram(...) in the above example. host reporters are used to log messages, these reporters do not receive the list of tags and therefore are not able to do anything with it. remote reporters are used to make more complex logs, they receive only the list of tags, the message is appended to the tag list as "message" => "the message". You can create your own reporters by implementing HostLogInterface or RemoteLogInterface more about this later.

SystemLogger

include:

methods:

The system logger is used as a central storage unit, it does not perform any logging by itself instead it is responsible for message processing and reduction of code duplication since the same tags and message are passed to all of the provided reporters.

Default Tags

The following are the default tags that will be appended to the provided list.

Message Placeholders

There are two kinds of message placeholders tag and reporter.

tag placeholder is identified with a : followed by the key of one of your tags, in the above example :name is a valid tag. reporter placeholder is identified by : followed by the index of one of your reporters so in the above example :1 would be replaced with the value of DataDog.histogram("messages", 2) which in this case would be 2.

Notes

Default Reporters

These are responsible for the actual logging of information. At the moment there are two default reporters built in CommandLine and DataDog.

CommandLine

This is a basic reporter that will simply echo messages to the standard out.

DataDog

include:

methods:

suffix is the last part of your DataDog metric name. All DataDog metric names will consist of DATADOG_PROJECT_NAME.suffix where DATADOG_PROJECT_NAME is loaded from ENV, if these variables are not set then the beginning of your metric will default to notset.suffix. In Addition all DataDog logs will be sent with additional tag DATADOG_SERVICE_NAME which is also loaded from ENV, if this variable is not set then it will default to value notset.

Custom Reporters

You can create your own host or remote reporters by creating a class and implementing HostLogInterface or RemoteLogInterface respectively.

HostLogInterface

include:

methods:

Each method receives the message with replaced placeholders. If an exception is thrown in the reporter then it should be caught and returned, the system logger will re-throw it once all other logs are performed. An example of laravel standard out reporter can be found here.

RemoteLogInterface

include:

methods:


All versions of system_logger with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8.0
graze/dog-statsd Version ^1.0
lstrojny/functional-php Version ^1.17
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 mvf-tech/system_logger contains the following files

Loading the files please wait ....