---
title: How to Log Custom Events in PublishPress Activity
description: "PublishPress Activity provides a flexible API to log and store custom events. An example of logging a custom event is below. This example is recording information from Stripe.com for a customer: ``` Logtivity::log() ->setAction('My Custom Action') ->setContext('My Custom Context') ->addMeta('Meta…"
url: "https://activity.publishpress.com/docs/custom-events/"
updated: "2026-12-03"
---

# How to Log Custom Events in PublishPress Activity

PublishPress Activity provides a flexible API to log and store custom events. An example of logging a custom event is below. This example is recording information from Stripe.com for a customer:

```
Logtivity::log()
    ->setAction('My Custom Action')
    ->setContext('My Custom Context')
    ->addMeta('Meta Label', $meta)
    ->addMeta('Another Meta label', $someOtherMeta)
    ->addUserMeta('Stripe Customer ID', $stripeCustomerId)
    ->send();
```
