π 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.