Custom Transports
Send logs to external services with custom transports.
Logixlysia allows you to send logs to external services using custom transports. By default, transports work alongside the built-in console and file logging outputs.
Output Behavior
Logixlysia supports three types of logging outputs:
- Console Logging - Built-in console output (can be disabled with
disableInternalLogger) - File Logging - Built-in file output (can be disabled with
disableFileLogging) - Transport Logging - Custom external services (always additive)
Controlling Outputs
- Default behavior: Console + File (if
logFilePathis set) + Transports disableInternalLogger: true: Disables console logging onlydisableFileLogging: true: Disables file logging onlyuseTransportsOnly: true: Disables both console and file logging, uses only transports
Basic Transport
Create a basic transport:
External Services
Elasticsearch Transport
MongoDB Transport
Slack Transport
Multiple Transports
Use multiple transports together:
Advanced Configuration
Transport-Only Logging
To use only transports (disable console and file logging):
Note: In useTransportsOnly mode, logFilePath and console output are ignored.
Selective Output Control
Best Practices
-
Error Handling
- Handle transport errors gracefully
- Implement retry logic
- Log transport failures
-
Performance
- Use async transports
- Implement batching
- Consider rate limiting
-
Security
- Secure transport credentials
- Validate log data
-
Output Management
- Use
useTransportsOnlyfor production environments where you only want external logging - Use
disableFileLoggingwhen you want console output but not file output - Use
disableInternalLoggerwhen you want file/transport output but not console output - Avoid logging secrets or PII; redact sensitive fields where unavoidable
- Implement access control
- Use