Download the PHP package timefrontiers/php-error-log without Composer

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

TimeFrontiers PHP Error Log

A confined, injection-safe flat-file diagnostic logger with bounded pagination, rotation, retention, and v1 record compatibility.

Requirements

Configure a confined logger

The generated target is {root}/errors/{YYYY-MM}/{process}.log, or {root}/logs/... when is_error_log is false. An empty process name produces a date-based filename.

The process name is a basename, not a path. Active log stems are limited to 166 characters so the complete timestamped rotation filename remains within the package's leaf bound. Separators, drive names, .., NULs, Windows alternate streams and reserved device names are rejected. The same active-stem limit applies to confined custom targets. A leaf matching the package's timestamped rotation grammar is reserved: it is accepted only inside the exactly owned .process.rotated store under the platform's case rules and never falls back to an ordinary custom filename. The configured root is canonicalized, generated and custom targets must remain beneath it, and existing symbolic links in the path are rejected. setFile() and the optional path passed to read() accept only confined .log files:

Directories and files created by the package are set to 0700 and 0600 where POSIX modes are supported. On Windows, chmod() is best effort and does not replace NTFS ACL configuration; provision the root with an account-specific ACL. The root must remain application-owned because PHP does not expose a portable openat(O_NOFOLLOW) equivalent for closing every filesystem race.

Stable response statuses

0.0, 0.1, and 0.2 are complete statuses and require zero errors. 1. through 5. are typed prefixes and receive the normalized error count. A caller may supply a complete error status such as 4.2 only when it exactly matches the two supplied errors. Malformed values, controls and record delimiters fail closed.

The existing write(ResponseStatus|string, string, string|array): bool entry point remains available. Array values are deliberately limited to finite scalars and null; nested arrays, resources and objects are rejected rather than converted accidentally.

Structured diagnostics and redaction

Keep guest-safe text separate from internal context:

DefaultRedactor is the central hook for public text, details and structured context. It removes common credentials, authorization tokens, email addresses, card-like values, SQL statements and stack frames. Sensitive context keys—including SQL, tokens, credentials, personal data, provider payloads and stack traces—are replaced wholesale. A custom RedactorInterface may enforce a stricter application policy.

Do not pass raw SQL/database errors, credentials, tokens, personal data, provider payloads or exception traces as supposedly safe text. The default redactor is a final containment layer, not authorization to collect secrets.

Versioned record format

New records use format version 2:

The physical record remains one line. Version 2 escapes %, />, :>, \>, CR and LF before serialization, then decodes them in reverse order. Literal escape-looking input therefore remains literal and cannot forge another field or record. The reader also accepts valid v1 lines and normalizes the old 0.00, 0.10, and 0.20 serialization defect to 0.0, 0.1, and 0.2.

Default bounds are 50 diagnostics, 64 KiB per record, 10 MiB per active file and 10 MiB per read snapshot. A record that exceeds a bound is not written.

Reads and failure states

ReadState distinguishes missing, empty, ok, partial, and failed. A partial result contains valid records plus a malformed-record count. read() remains the compatibility adapter returning only the valid entries; inspect getReadState() or getLastReadResult() when the distinction matters.

Active-file readers take a shared companion lock and cache a bounded snapshot for pagination. Writers take the paired exclusive lock, so cooperating readers never see a partially appended record. Rotated-file readers share one stable .process.rotated.lock beside the private rotation directory; retention takes that same lock exclusively before inspecting or deleting rotations. Windows ownership and lock mapping use the same ASCII case-insensitive comparison and a lowercase stable-lock stem, so accepted active/store/file case variants cannot split reader and retention locks. Reusing the logger with read(null, $nextPage, $limit) reuses the snapshot when file metadata is unchanged. Failures expose only a stable safe message through getLastFailure() and an exception class through getLastFailureType(); paths and raw internal exception messages remain private.

print_r() and var_dump() receive a bounded ErrorLog projection containing only read state, pagination counts and the safe failure/type. Retained paths, collaborators and exception graphs are excluded. ErrorLog and LogRecord both reject serialization and unserialization; LogRecord debugging exposes only status, byte length and counts, never public text or internal-context keys/values.

Rotation and retention

Before an append would cross maxFileBytes, the active file is renamed to:

The append then creates a new private active file. Each active log owns a private rotation directory, so unrelated files before or after the process filename in the active directory are never enumerated. The 166-character active-stem contract is also used to recognize rotated names and derive locks, including confined custom files. Rotation locking uses the single sibling .process.rotated.lock, not per-rotation files inside the directory. On writes, retention holds that lock exclusively and uses a memory-lazy iterator over package-owned rotation candidates. Current rotations do not consume the deletion budget; each pass removes at most maxRetentionDeletes expired rotations, regardless of directory order. This is a deletion bound, not a bound on the number of directory entries inspected. Rotated reads leave only the stable sibling lock, so their artifacts cannot consume every later batch; when more expired rotations exist than one deletion batch permits, later writes continue converging. Set retentionSeconds to 0 to disable automatic deletion.

Development gate

CI runs the gate on PHP 8.5 with current and lowest supported dependencies.

License

MIT. See LICENSE.


All versions of php-error-log with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
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 timefrontiers/php-error-log contains the following files

Loading the files please wait ...