TritonLwc
Documentation for the TritonLwc Apex class that provides core logging functionality for Lightning Web Components.
Overview
The TritonLwc class provides the server-side implementation for Lightning Web Component logging. It handles the reception and processing of client-side logs, managing transaction context, and ensuring proper log persistence.
LWC Logging Methods
saveComponentLogs
Creates logs from LWC components with automatic transaction management and context capture.
Field Mapping Reference
Core Fields
category()
componentLog.category
LWC
Component classification
type()
componentLog.type/error.type
Frontend
Technical classification
area()
componentLog.area/componentInfo.name
LWC
Functional area
level()
componentLog.level
INFO
Log severity
summary()
componentLog.summary/error.message
-
Main log message
details()
componentLog.details + validation
-
Extended information
stackTrace()
componentLog.stack
-
Error stack trace
Context Fields
🔍 Component Context The system automatically captures rich component execution context:
Related Objects
🔗 Record Context The system supports linking logs to Salesforce records:
Automatic Behaviors
⚡ Smart Processing The system provides intelligent handling of log data:
Transaction Management
Creates new transaction if none exists
Maintains transaction context across components
Correlates related logs
Context Enrichment
Captures component hierarchy
Records runtime metrics
Preserves error context
Data Validation
Validates all incoming fields
Provides sensible defaults
Maintains data integrity
Validation Rules
Required Field Validation
Category
Must be valid enum
Falls back to LWC
Type
Must be valid enum
Falls back to Frontend
Area
Must be valid enum
Uses component name
Level
Must be valid enum
Falls back to INFO
ID Validation
📝 Record ID Processing The system validates record IDs by:
Checking ID format (15 or 18 chars)
Filtering invalid IDs
Maintaining valid relationships
Error Handling
🛡️ Validation Strategy When validation issues occur:
Invalid values get appropriate defaults
Validation messages are added to details
Processing continues uninterrupted
Runtime Information
The system captures comprehensive runtime context:
Performance
Page load, DOM events, Paint times
Environment
User agent, Platform, Language
Network
Connection type, Speed, RTT
Memory
Heap usage, Limits
Device
Form factor, Screen dimensions
Related Classes
The TritonLwc class works with several wrapper classes:
ComponentLog - Main wrapper for LWC log data
Component - Component context information
Error - Error details structure
RuntimeInfo - Runtime metrics and context
Last updated