Collecting Tomcat Access and Garbage Collector Logs
Overview
You can configure OpenTelemetry Collector to read Tomcat Server Access and Garbage Collector logs and push them to SigNoz for analysis.
Steps to Collect Logs in SigNoz Cloud
1. Install OpenTelemetry Collector
The OpenTelemetry Collector provides a vendor-neutral way to collect, process, and export telemetry data (logs, metrics, traces). Follow this installation guide.
2. Configure Filelog Receiver
Modify the config.yaml
file from the installation to include the filelog receiver:
config.yaml
receivers:
filelog/access_logs:
include: [/<path_to_access_log>/localhost_access_log.*] # Path to access logs
start_at: end
filelog/gc_logs:
include: [/<path_to_gc_log>/garbage-collection.log.*] # Path to garbage collector logs
start_at: end
✅ Info
- Use
start_at: end
to transmit only new logs. Change tobeginning
to include historical logs. - Update log paths using server arguments:
- Access logs:
-Dcatalina.base=<new_access_logs_path>
- GC logs:
-Xloggc:<new_gc_logs_path>
- Access logs:
3. Update Pipelines Configuration
In the same config.yaml
, add the receivers to the pipeline:
config.yaml
service:
logs:
receivers: [otlp, filelog/access_logs, filelog/gc_logs]
processors: [batch]
exporters: [otlp]
4. Restart the OTel Collector
Apply changes by restarting the OTel Collector.
5. Verify Export
Check the SigNoz UI for the exported logs.