Documentation
¶
Overview ¶
Package cloudlogging provides Cloud Logging adapter for batch logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatLogEntry ¶
func FormatLogEntry(entry *logging.Entry, maxLen int) ports.BatchLogEntry
FormatLogEntry extracts a cleaned, human-readable message from a Cloud Logging entry. Message extraction priority:
- String payload (text message)
- JSON payload with "message" key
- JSON payload (stringified)
- Fallback: fmt.Sprintf("%v", payload), truncated
The returned message is truncated to maxLen characters.
Types ¶
type CloudLoggingRepository ¶
type CloudLoggingRepository struct{}
CloudLoggingRepository implements BatchLogsRepository using Google Cloud Logging.
func NewCloudLoggingRepository ¶
func NewCloudLoggingRepository() *CloudLoggingRepository
NewCloudLoggingRepository creates a new Cloud Logging adapter.
func (*CloudLoggingRepository) GetLogs ¶
func (r *CloudLoggingRepository) GetLogs( ctx context.Context, jobName string, filter ports.BatchLogsFilter, ) ([]ports.BatchLogEntry, error)
GetLogs retrieves batch logs from Cloud Logging API. Uses Application Default Credentials (ADC) for authentication. projectID is extracted from the jobName resource.
Click to show internal directories.
Click to hide internal directories.