๐ Duck Logging Systemยถ
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/logsCan 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 logsNoneโ Auto-selects based onUSE_DJANGOsetting
VERBOSE_LOGGINGยถ
Provides detailed exceptions with tracebacks.
Always
TrueinDEBUGmode.Set to
Falseto 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 |
|---|---|
|
Sort logs by |
|
Show log sizes in human-readable units (KB, MB) |
|
Target a specific number of logs |
Other Commandsยถ
sizeโ Shows total size of all logscountโ Counts total number of logs
โจ Duck logging allows you to track, analyze, and manage logs efficiently, whether for development, debugging, or production monitoring.