Rotating file writer for access logs. Handles log file rotation based on size with configurable max files.
Rotating file writer for access logs. Handles log file rotation based on size with configurable max files.
(create-writer &
{:keys [path max-size-mb max-files]
:or {path "logs/access.log" max-size-mb 100 max-files 10}})Create a rotating file writer.
Options: :path - Log file path (default: "logs/access.log") :max-size-mb - Max file size in MB before rotation (default: 100) :max-files - Max number of rotated files to keep (default: 10)
Returns a FileWriterState record.
Create a rotating file writer. Options: :path - Log file path (default: "logs/access.log") :max-size-mb - Max file size in MB before rotation (default: 100) :max-files - Max number of rotated files to keep (default: 10) Returns a FileWriterState record.
(flush! state)Flush the file writer buffer.
Flush the file writer buffer.
(write-line! state line)Write a line to the log file with automatic rotation.
Returns updated FileWriterState.
Write a line to the log file with automatic rotation. Returns updated FileWriterState.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |