---
title: How to Log Custom Events in Logtivity
description: "Logtivity 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',…"
url: "https://logtivity.io/docs/custom-events/"
updated: "2024-10-03"
---

# How to Log Custom Events in Logtivity

Logtivity 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();
```
