Skip to main content

Logger

Logger

The logger component enables you to control the log levels of other components and activities in Viseron.

Logs are in the format: [timestamp] [level] [log_name] - message

Configuration

Configuration example
logger:
default_level: info
logs:
viseron.components.ffmpeg: debug
viseron.components.edgetpu: debug
cameras:
camera_one: debug
loggermap required
Logger configuration.

Available levels

This list shows the available log levels sorted by severity. Logging messages which are less severe than the given level will be ignored.

  • critical
  • error
  • warning
  • info
  • debug

View logs

Example command to examine the logs:

docker logs -f viseron

A logfile is also created in the config directory named viseron.log.

Log rotation

By default the log file is rotated on each restart of Viseron.

If you want to rotate the log file based on size and also keep a certain number of old logs, you can use the environment variables VISERON_LOG_MAX_BYTES and VISERON_LOG_BACKUP_COUNT.

docker run --rm \
-v {segments path}:/segments \
-v {snapshots path}:/snapshots \
-v {thumbnails path}:/thumbnails \
-v {event clips path}:/event_clips \
-v {config path}:/config \
-v /etc/localtime:/etc/localtime:ro \
-p 8888:8888 \
--name viseron \
--shm-size=1024mb \
-e VISERON_LOG_MAX_BYTES=100mb \
-e VISERON_LOG_BACKUP_COUNT=5 \
roflcoopter/viseron:latest
tip

The VISERON_LOG_MAX_BYTES variable supports the following suffixes: b, kb, mb, gb, tb.

Debugging a camera

If one of your cameras is malfunctioning you might need to enable debug logging for it to gain some more insight or raise an issue.

Setting default_level to debug will create a lot of noise. To isolate the logs of a specific camera, use the cameras config option. The following example will enable debug logging for all logs related to the camera with the identifier camera_one.

logger:
cameras:
camera_one: debug

Debugging a component

If you are experiencing issues with a specific component, you can enable debug logging for it. The following example will enable debug logging for all logs related to the ffmpeg component.

logger:
logs:
viseron.components.ffmpeg: debug

Global debug logging

To enable debug logging for the entire application, set default_level to debug.

logger:
default_level: debug