> For the complete documentation index, see [llms.txt](https://triton.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://triton.pharos.ai/core-concepts/enums.md).

# Enums

The Category, Type, and Area enums in TritonTypes — what each one classifies, the values that ship out of the box, and how to extend them for your own org.

Three fields classify every Triton log: **Category**, **Type**, and **Area**. Getting them right is what turns a pile of log records into something you can filter, group, and actually learn from. All three are defined as enums in `TritonTypes.cls`, plus a fourth enum — `Level` — for severity.

Why enums instead of free-text strings? Consistency. If half your team writes `"Accounts"` and the other half writes `"Account"`, no filter will ever line up. Enums make the value set explicit, discoverable in your IDE, and safe to refactor. You *can* pass raw strings where you need to (`.type(...)` and `.area(...)` accept them), but reach for the enum first.

## Category — the broad bucket

Category is the highest-level classification, and it matters for more than filtering: Pharos uses it to decide which page layout and detail view to render for the record. Mislabel an Apex log as a Flow log and it'll still capture your data, but the detail page won't show the Apex stack trace where you expect it.

The values that ship in `TritonTypes.Category`:

`Apex` · `Flow` · `LWC` · `Aura`

Category answers exactly one question — *what technology produced this log?* Severity is never expressed through Category; that's what the `Level` enum is for.

**Rule of thumb: match the technology you're logging from.** Logging from Apex? Use `Apex`. From a Lightning web component? `LWC`. Logging around a callout or integration from Apex? Keep the `Apex` category and attach the HTTP exchange with `.integrationPayload(...)` — there's no need to reach for a separate category or entity for integration logging. Many of Triton's built-in methods set the category for you — `Triton.makeBuilder()` starts you on `Apex`.

{% hint style="info" %}
Pharos' automated error capture also produces records under platform categories that aren't in this enum (for example Flow, Process Builder, Email-to-Case, Web-to-Lead). Those are set for you during automatic capture. For your own custom logging, stick to the enum values above.
{% endhint %}

## Type — the technical detail

Type is a finer, more technical classification written to the Type field. It doesn't affect how the record renders, so you have more freedom here. The out-of-the-box values in `TritonTypes.Type`:

| Value                                                                                        | Typical use                                                                                                                                                                                                                         |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Backend`                                                                                    | Server-side Apex work (the common default).                                                                                                                                                                                         |
| `Frontend`                                                                                   | Client-side / UI-originated logs.                                                                                                                                                                                                   |
| `DMLResult`                                                                                  | Logs summarizing bulk DML outcomes.                                                                                                                                                                                                 |
| `LongRunningRequest`                                                                         | Slow requests worth flagging.                                                                                                                                                                                                       |
| `ConcurrentRequestsLimit`                                                                    | Concurrency-limit conditions.                                                                                                                                                                                                       |
| `AccountTrigger`                                                                             | Example of a domain-specific type.                                                                                                                                                                                                  |
| `BackendCall` · `UserInteraction` · `ComponentLifecycle` · `ComponentRender` · `Performance` | Set by the LWC profiling APIs — see [Profiling](https://triton.pharos.ai/beyond-apex/profiling.md). `Performance` is also set by Apex [performance marks](https://triton.pharos.ai/common-apex-usage-patters/performance-marks.md). |

When you log an exception via `.exception(e)`, Triton sets the Type to the **exception's own type name** (e.g. `DmlException`, `CalloutException`), falling back to `Backend` when it can't determine one. That's usually exactly what you want.

## Area — the business context

Area (written to the **Functional Area** field) describes *what part of the business* a log is about, from a business perspective rather than a technical one. This is the classification you'll customize the most, because it's the most org-specific. The starter values in `TritonTypes.Area`:

`OpportunityManagement` · `LeadConversion` · `Community` · `RestAPI` · `Accounts` · `LWC` · `Flow`

Good areas read like features or domains: `DealRegistration`, `PartnerCommunity`, `InvoiceSync`, `AccountEnrichment`. Aim for the level of granularity you'd actually want to filter or alert on.

{% hint style="success" %}
**Add your own functional areas — but not by editing this enum.** There is no universal set of functional areas; the shipped values are just a starting point. Defining your own domains is expected and encouraged — just do it the upgrade-safe way, with your own `String`-constant classes rather than by editing `TritonTypes.cls`. See [Custom Classifications](https://triton.pharos.ai/core-concepts/custom-classifications.md).
{% endhint %}

## Level — severity

The fourth enum, `TritonTypes.Level`, ranks severity from least to most verbose: `ERROR` · `WARNING` · `INFO` · `DEBUG` · `FINE` · `FINER` · `FINEST`. It gets its own page because it also drives runtime filtering — see [Log Levels](https://triton.pharos.ai/core-concepts/log-levels.md).

## Adding your own values — the upgrade-safe way

Sooner or later you'll want classifications the shipped enums don't cover — an `InvoiceSync` area, a `Callout` type. The tempting move is to add them straight to the enum in `TritonTypes.cls`. **Resist it.** Apex enums can't be extended from the outside, so the only way to add a value is to edit the shipped `TritonTypes.cls` — and that file belongs to Triton. Your additions get clobbered (or cause merge conflicts) the next time you upgrade.

Treat the built-in enums as convenient defaults you *use* as-is, not values you extend. When you need your own `Type` and `Area` values, define them as `public static final String` constants in your *own* classes and pass them to `.area(...)` / `.type(...)`:

{% code lineNumbers="true" %}

```apex
Triton.info(Triton.t.area(TritonArea.INVOICE_SYNC).summary('Invoice pushed to ERP'));
```

{% endcode %}

Those constant classes are yours, so no Triton upgrade will ever touch them — and you keep the consistency, typo-safety, and IDE discoverability that made enums appealing in the first place. See [Custom Classifications](https://triton.pharos.ai/core-concepts/custom-classifications.md) for the full pattern (and why `Category` is the one exception you should still leave as an enum).

Keep additions deliberate and documented — the value of a taxonomy is that everyone uses the same one. For guidance on designing a taxonomy that scales, see [Taxonomy & Standards](https://triton.pharos.ai/triton-best-practices/taxonomy-and-standards.md).
