Download the PHP package jitesoft/wp-logger without Composer

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

Wp-logger

An actual logger for WordPress.

This plugin does two things. It piggybacks on the internal php logger (via set_error_handler) and it creates a PSR logger for you to use!

More in-depth

When the plugin have loaded completely in WordPress, it will fire the jitesoft_logger_loaded action, the callback will be passed the global logger object.
If you know that the plugin is loaded, you can as well use the jitesoft('logger') function to request the logger instance. In case it is not yet loaded, the function will return null:

Deprecation notice, the following will be removed in next major version

It's also possible to fetch the logger through the GlobalLogger class through the logger() method:

Auto-loading

The plugin requires auto-loading to function properly. Without the autoloader, the plugin won't be able to find the libraries it uses and hence will not create a logger.

Configuring

The plugin is currently configured via environment variables or defines. The values must be defined before loading the plugin, so the wp-config.php file or actual environment variables are preferable places to put those.

WP_LOGGER_OVERRIDE is default set to override, can be changed to disable to not override the internal php logger.

WP_ENV sets the default logging level on the logger:

In case you wish to change the logging level manually, you can set the WP_LOGGER_LEVEL to an appropriate level, the following are accepted: debug, notice, info, warning, error, critical, alert, emergency.

You can also change the log level by fireing the jitesoft_log_level hook with a single string parameter with a value of the above log levels.

Formatting

Currently, the logger supports two default types: json, stdout.
They are possible to set with the WP_LOGGER_FORMAT variable (stdout is default).
Both of the types will output to the stdout/stderr channel (the terminal) while they will produce either clear text logs or json formatted logs.

If you wish to change the loggers on the logging object, it's possible to do so by querying the logger and add (or remove) loggers from it. Multiple loggers can be added:

Or directly in the hook:

Installation

Use a composer based WordPress installation and require this plugin.

Loggers

If you wish to add more loggers, the package depends on the jitesoft/loggers php package, which contains multiple different loggers.
If you wish to use your own loggers, the logger must implement the PSR-3 logger interface.

License

MIT!


All versions of wp-logger with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1.11
ext-json Version *
jitesoft/loggers Version >=2.3.0
php Version >=7.4.2
jitesoft/wp-base Version ~1.1.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 jitesoft/wp-logger contains the following files

Loading the files please wait ....