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

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 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 identifying the subsystem that produced the entry (e.g. admin, access, etc.)
  • message: Log message
  • Additional contextual fields depending on the log entry

Example log entry:

{
  "time": "2026-04-16T10:30:45Z",
  "level": "info",
  "topic": "admin",
  "message": "Recording created",
  "channel": "channel-1",
  "id": "01HP2Q3R4S5T6U7V8W9X0Y1Z2"
}

Troubleshooting

Common Log Locations to Check

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