๐Ÿ“ Duck Logging Systemยถ

Logging
Duck Framework


Duck provides an extensive and customizable logging system to track your applicationโ€™s behavior and errors.

By default, every Duck app session is logged to a file. To disable file logging, set:

LOG_TO_FILE = False

โšก Other Logging Optionsยถ

SILENTยถ

Disables all logging, including console output and log files.

  • Useful in testing environments to avoid unnecessary logs.

DJANGO_SILENTยถ

Disables logging only for Django integration (USE_DJANGO=True).

LOGGING_DIRยถ

Directory to store log files.

  • Default: assets/logs

  • Can be customized to any directory path.

LOG_FILE_FORMATยถ

Controls the filename format for log files.

  • Default: Uses [year, month, day]_[hour, minutes, seconds]

  • Avoids : in time for Windows compatibility.

PREFERRED_LOG_STYLEยถ

Choose the preferred log style:

  • "duck" โ†’ Clean, readable logs (default)

  • "django" โ†’ Django-style logs

  • None โ†’ Auto-selects based on USE_DJANGO setting

VERBOSE_LOGGINGยถ

Provides detailed exceptions with tracebacks.

  • Always True in DEBUG mode.

  • Set to False to reduce verbosity.


๐Ÿ–ฅ๏ธ Logs CLIยถ

Duck comes with a command-line tool for managing logs.

cd myduckproject
duck logs list   # List all logs
duck purge       # Delete all logs

CLI Flagsยถ

Flag

Description

-s

Sort logs by "oldest", "newest", "largest"

-ss

Show log sizes in human-readable units (KB, MB)

-n

Target a specific number of logs

Other Commandsยถ

  • size โ†’ Shows total size of all logs

  • count โ†’ Counts total number of logs


โœจ Duck logging allows you to track, analyze, and manage logs efficiently, whether for development, debugging, or production monitoring.