---
title: Export
date: 2026-06-13T16:16:00+01:00
author: John Henry Donovan
canonical_url: "https://johnhenry.ie/plugins/order-lifecycle/docs/guide/export"
section: Plugins
---
esc

↑↓ to navigate↵ to selectesc to close

Menu On this page 

- [Return to top](#)

Documentation

Documentation

# Export

Order Lifecycle events can be exported as a CSV file for analysis in spreadsheets, BI tools, or data warehouses. You'll find the export feature under **Order Lifecycle → Export** in the Craft sidebar.

## Date Range

### Presets

Quick-select buttons cover the most common windows you'd need:

PresetDescriptionTodayMidnight to 23:59:59 todayYesterdayFull previous dayLast 7 / 30 / 90 daysRolling window from nowThis MonthFirst to last day of the current calendar monthLast MonthFull previous calendar monthThis Year1 January to todayLast 365 daysRolling one-year windowAll TimeEvery event in the database (from 1 January 2000)

Clicking a preset highlights it and fills in the **Date From** and **Date To** fields for you.

### Custom Range

The **Date From** and **Date To** fields take any date and time. Set them manually to export a specific window.

## Filtering

### Order ID

Enter a specific order ID to export events for just that one order. Leave it blank to include all orders in the date range.

### Event Types

Check individual event types to limit the export to those events. If none are selected, all event types are included.

The event types are presented as a grouped checkbox list inside a semantic `<fieldset>`, so the whole group is announced together by assistive technology.

![](https://johnhenry.ie/images/plugins/docs/order-lifecycle/export-form.png)## Columns

The **Columns to Export** table controls which fields appear in the CSV, and in what order. Toggle each column on or off with its lightswitch, and drag rows by their handle to reorder columns.

ColumnDescriptionLog IDInternal log entry IDDate/Time`dateCreated` timestampOrder IDCommerce order IDOrder NumberCommerce order number (hash)Event TypeEvent type string (e.g. `orderCompleted`)MessageAuto-generated or custom event descriptionCustomer EmailEmail address on the order at export timeOrder StatusCurrent order status nameTotal PriceOrder total at export timeCurrencyOrder currency codePayload (JSON)The `payload` key from the event snapshot``

Warning **Customer Email**, **Order Status**, **Total Price**, and **Currency** reflect the order's current state, not its state at the time the event was logged. Use the **Payload (JSON)** column for point-in-time values captured in the snapshot.

## Downloading

Click **Export CSV** to download the file. It's named `lifecycle-events-YYYY-MM-DD-HHmmss.csv`.

## Console Alternative

Large exports are better done via the CLI, to avoid HTTP timeouts:

```php
php craft order-lifecycle/logs/stats
```

For a programmatic export, query the `orderlifecycle_logs` table directly through Craft's database layer:

```php
use craft\db\Query;

$rows = (new Query())
    ->select(['id', 'orderId', 'type', 'message', 'dateCreated'])
    ->from('{{%orderlifecycle_logs}}')
    ->where(['>=', 'dateCreated', '2024-01-01 00:00:00'])
    ->orderBy(['dateCreated' => SORT_ASC])
    ->all();
```

## Related Documentation

- [Statistics](https://johnhenry.ie/plugins/order-lifecycle/docs/guide/statistics) - Store-wide metrics dashboard
- [Configuration](https://johnhenry.ie/plugins/order-lifecycle/docs/getting-started/configuration) - Log pruning and maintenance settings
- [Services API](https://johnhenry.ie/plugins/order-lifecycle/docs/api/services) - Programmatic access to log data

On this page
