Download the PHP package brunoggdev/ci4-logging-extended without Composer

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

ci4-logging-extended

Extended logging for CodeIgniter 4 — part of the ci4-*-extended series.

Two things in one package:

  1. php spark log:tail — Watch your log file in real time with colorized, filtered output.
  2. Richer context serialization — CI4's native logger follows the PSR-3 spec strictly: context keys without a matching {placeholder} in the message are silently discarded. This package extends that behavior by appending leftover keys as key=value pairs automatically.

Installation


log:tail

On startup it shows the last 20 lines of today's log, then streams new entries as they arrive. Rolls over automatically at midnight when a new daily file is created.

Options

Option Description Default
-level Filter by log level
-filter Filter lines containing this text (case-insensitive)
-lines Lines to show on startup (use 0 to skip) 20

Examples

Output


Context serialization

This package ships with Brunoggdev\LoggingExtended\Logger, an improved drop-in replacement for CI4's native logger, and a logger() helper function to quickly get an instance of it.

Wire it up by adding the following to app/Config/Services.php:

PSR-3 only interpolates context keys that have a matching {placeholder} in the message — everything else is discarded by design. With the extended logger, leftover keys are appended automatically:

With the extended logger wired in, the same call produces:

PSR-3 placeholder interpolation still works as before — keys consumed by {placeholders} are not duplicated in the appended context:

Logging exceptions

The extended logger adds an exception() method that formats a Throwable into a clean log entry:

Need to also send exceptions to an external tracker (Sentry, GlitchTip, etc.)? Extend the logger and override exception() — calling parent:: keeps the file log entry:

Then wire your subclass in app/Config/Services.php instead of the base one.


Using a custom Logger subclass?

If you have a class that extends CI4's Logger (e.g. SentryLogger, GoogleLogger), just swap the parent import and you get context serialization for free:


Related packages


All versions of ci4-logging-extended with dependencies

PHP Build Version
Package Version
No informations.
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 brunoggdev/ci4-logging-extended contains the following files

Loading the files please wait ...