Search by

hypervel / activity-log

albertchtbinaryfire

Coroutine-safe activity logging for Hypervel applications.

Package info

github.com/hypervel/activity-log

Issues

pkg:composer/hypervel/activity-log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

0.4.x-dev 2026-12-01 12:51 UTC

This package is auto-updated.

Last update: 2026-12-03 12:06:32 UTC


README

Documentation: https://hypervel.org/docs/activity-log

Differences From Spatie Laravel Activity Log

  • Use the ActivityLog facade in place of Spatie's Activity facade. The config file and Artisan command prefix use activity-log, and environment settings use ACTIVITY_LOG_. The global helper is activity().
  • activity(null) selects the configured default. Empty string and "0" are distinct log names. useLog(null) and inLog(null) explicitly set a null name.
  • Automatic model logging uses the event's in-memory snapshot without another subject query. refreshBeforeLogging() provides an explicit, transaction-only refresh for database-generated values.
  • Dotted relation attributes retain the configured key even when traversal resolves a snake-case, camel-case, or dynamic-relation alias.
  • The activity model's connection owns the write. Spatie can defer a write on another connection until the subject commits. Hypervel supports a separate activity database, but a rollback on the subject connection does not discard that activity. For atomic audit writes, disable buffering and use the same connection and transaction. For durable cross-database delivery, use an application outbox.
  • Optional buffering is coroutine-scoped and flushes in bounded batches at request and job boundaries. If an insert fails, its attempted batch is discarded because retrying an ambiguous write can duplicate rows. Unattempted rows remain eligible to flush.
  • The facade resolves a stateless ActivityLogManager. Each fluent root call gets a fresh logger, and reusing a logger after log() starts a new activity even when the previous call failed or logging was disabled.
  • Register callbacks and macros at worker boot. Resolve request-specific values such as a batch UUID when the callback runs, since the same registration serves later requests. See Callbacks and Macros.
  • Hypervel reads package settings through ActivityLogConfiguration. Omitted top-level settings use package defaults. If you supply a buffer group, include both enabled and batch_size. Explicitly setting activity_model or enabled to null is invalid.
  • Cleanup uses the model's configured created-at column and primary key to delete bounded batches. A custom model can record keyless activities, but the built-in cleanup action requires a primary key.
  • setLogStatus() is replaced by enableLogging(), disableLogging(), and withoutLogging(). Tests reset callbacks through flushState() rather than the upstream test-only clearBeforeLoggingCallbacks() alias.
  • This package cannot be installed alongside spatie/laravel-activitylog because both packages provide activity() and use the same default table.

Ported from: https://github.com/spatie/laravel-activitylog