Download the PHP package kodansha/wack-log without Composer

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

WACK Log

WACK Log is a simple WordPress plugin to output logs to the stdout.

It is created as a thin Monolog wrapper with the intention of being used with the WACK Stack, but it can also be used with other WordPress installations, especially convenient for those that are containerized.

Installation

Using Composer

[!NOTE] This plugin is not available on the WordPress.org plugin repository. For the moment, the only way to install it is to use Composer.

Usage

WACK Log exposes a global function logger() that can be used as below:

In addition, it also provides a shorthand usage that is convenient for debugging:

Each method also accepts a context array as the second argument:

Capturing PHP errors

When the capture_php_errors setting is enabled, WACK Log replaces PHP's standard error log, so that PHP errors and WordPress debug messages are also output through WACK Log (in JSON if use_json_format is enabled):

Source Log level Notes
Warnings (E_WARNING, E_USER_WARNING, ...) WARNING Not passed to PHP's standard error log
Notices and deprecations (E_NOTICE, E_DEPRECATED, ...) NOTICE Not passed to PHP's standard error log
Fatal errors and uncaught exceptions CRITICAL Logged on shutdown, or right before WordPress shows its critical error page
_doing_it_wrong(), _deprecated_function() and other _deprecated_*() (only when WP_DEBUG is true) NOTICE Logged with structured context, and their trigger_error() calls are suppressed to avoid duplicates

[!NOTE] Please be aware of the following limitations:

  • error_reporting() and the @ operator are respected, including for fatal errors and WordPress debug messages (which are treated as E_USER_NOTICE for _doing_it_wrong() and E_USER_DEPRECATED for _deprecated_*()).
  • Errors raised before WACK Log is loaded (e.g. in wp-config.php, WordPress core bootstrap or must-use plugins) are not captured.
  • Messages passed directly to error_log() are not captured.
  • Fatal errors are also written to PHP's standard error log because PHP itself handles them. Set log_errors to Off if you don't want them.
  • When the memory limit is exceeded, memory_limit is raised by 8 MiB on shutdown so that the error can still be logged.
  • Since non-fatal errors are no longer passed to PHP's standard error handler, they are not written to wp-content/debug.log or displayed on the screen even if WP_DEBUG_LOG / WP_DEBUG_DISPLAY are enabled. If another error handler (e.g. an error tracking service) was registered before WACK Log, it is still called, but captured errors are not passed to PHP's standard error handler even if it returns false. Note that it is called for every error type even if it was registered for specific types only, as PHP provides no way to know them.
  • Uncaught exceptions are not handled by an exception handler, so that WordPress' fatal error handler and recovery mode keep working.

Configuration

There are two methods for customizing the behavior of WACK Log:

Setting via WACK_LOG_SETTINGS

Define WACK_LOG_SETTINGS in wp-config.php (or config/application.php for Bedrock):

Key Default Description
use_json_format false Output logs in JSON format
capture_php_errors false Capture PHP errors and WordPress debug messages (see Capturing PHP errors)

[!IMPORTANT] capture_php_errors is read when WACK Log is loaded, so the constant must be defined before plugins are loaded. Defining it in a theme's functions.php has no effect on capture_php_errors.

Setting via WordPress admin menu

Go to the settings screen of WACK Log in the WordPress admin menu and follow the instructions on the screen.

[!NOTE] If settings exist both in WACK_LOG_SETTINGS and the admin menu settings at the same time, the settings defined in the constant are prioritized as a general rule.


All versions of wack-log with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
monolog/monolog Version ^3.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 kodansha/wack-log contains the following files

Loading the files please wait ...