Logging

Logging in ew-npvr

Log Files

ew-npvr maintains separate log files for different operational areas to facilitate troubleshooting and monitoring:

General Service Log

Location: /var/log/edgeware/ew-npvr/ew-npvr.log

Contains general service operational logs including:

  • Service startup and shutdown
  • Configuration changes
  • Database connection status
  • Job controller operations
  • Channel manager events
  • General errors and warnings

Streaming Log

Location: /var/log/edgeware/ew-npvr/ew-npvr-streaming.log

Contains logs specific to media streaming operations:

  • Media API requests
  • Content delivery events
  • Streaming errors
  • Cache operations
  • Thumbnail generation

Administration Log

Location: /var/log/edgeware/ew-npvr/ew-npvr-admin.log

Contains logs related to administrative operations:

  • Management API requests
  • Recording management operations
  • Channel configuration changes
  • Administrative actions

Log Rotation

Log files are rotated automatically using logrotate. The configuration is installed at:

/etc/logrotate.d/ew-npvr

The default rotation policy is:

  • Daily rotation
  • Keep 7 days of logs
  • Compress rotated logs
  • Create new log files with appropriate permissions

To manually rotate logs:

logrotate -f /etc/logrotate.d/ew-npvr

Viewing Logs

Using journalctl

View all service logs in real-time:

journalctl -u ew-npvr -f

View logs from the last hour:

journalctl -u ew-npvr --since "1 hour ago"

View logs with specific priority (error and above):

journalctl -u ew-npvr -p err

Using tail

Monitor the general log file:

tail -f /var/log/edgeware/ew-npvr/ew-npvr.log

Monitor the streaming log:

tail -f /var/log/edgeware/ew-npvr/ew-npvr-streaming.log

Monitor the administration log:

tail -f /var/log/edgeware/ew-npvr/ew-npvr-admin.log

Log Levels

The log level can be configured in the service configuration. Available levels:

  • trace: Most verbose, includes all debug information
  • debug: Detailed debugging information
  • info: Informational messages (default)
  • warn: Warning messages
  • error: Error messages
  • fatal: Fatal errors that cause service failure
  • panic: Panic-level errors

To change the log level, update the storage.npvr.logLevel configuration parameter. The change takes effect immediately without requiring a service restart.

Log Format

Logs are formatted as JSON for easy parsing and analysis. Each log entry contains:

  • time: Timestamp in RFC3339 format
  • level: Log level (trace, debug, info, warn, error, fatal, panic)
  • topic: Log topic (general, streaming, admin)
  • message: Log message
  • Additional contextual fields depending on the log entry

Example log entry:

{
  "time": "2026-04-16T10:30:45Z",
  "level": "info",
  "topic": "streaming",
  "message": "Media request processed",
  "channel": "channel-1",
  "duration_ms": 125
}

Troubleshooting

Common Log Locations to Check

  1. Service won’t start: Check general log and journalctl
  2. Streaming issues: Check streaming log
  3. API errors: Check administration log
  4. Database problems: Check general log for connection errors
  5. Configuration issues: Check general log for validation errors