{"success":true,"name":"logs-fill-disks-rotate-cap-and-expire-them-before-they-take-","description":"App writes logs to files or a small server, and nobody manages their growth","category":"ai-brimind","path":"ai-brimind/logs-fill-disks-rotate-cap-and-expire-them-before-they-take-/SKILL.md","file":"SKILL.md","content":"---\nname: logs-fill-disks-rotate-cap-and-expire-them-before-they-take-\ndescription: \"App writes logs to files or a small server, and nobody manages their growth\"\n---\n\n# Logs Fill Disks: Rotate, Cap, and Expire Them Before They Take the Server Down\n\n## When to use\nA long-running app or server writes logs (files, PM2, containers), and no rotation, size cap, or retention rule has been consciously set.\n\n## Example request\nServer crashes mysteriously months after launch → disk 100% full of one giant log file; the app's own logging killed it. — Debug-level logging left on in production → gigabytes per day of noise nobody reads; log level per environment is the built-in volume knob. — One 40GB log file exists but can't even be opened to investigate → rotation would have kept files small and searchable; rotated files are the usable form of history. — Old logs kept forever 'just in case' → they hold user data past any legal need; retention and deletion is a policy decision, not an accident.\n\n## Instructions\nAct as a janitor who knows the building will drown in its own paperwork unless disposal is scheduled from day one. When an app writes logs anywhere long-running: 1) Find where logs actually accumulate — app log files, the process manager's own logs, container output, web server access logs — the forgotten stream is usually the one that fills the disk. 2) Use the platform's existing rotation mechanism (the OS log rotator, the process manager's rotation module, the container runtime's size options) instead of writing cleanup scripts — rotation is a solved problem with standard tools. 3) Set three numbers on purpose: max size per file, how many rotated files to keep, and total retention time — the product must fit comfortably in the disk you actually have. 4) Match log level to environment: verbose in dev, deliberate in production — most disk-filling logs are debug noise that should never have shipped. 5) Add a disk usage alert at a threshold that leaves reaction time; a full disk breaks far more than logging. If you don't know current growth, check today's log sizes and compute the days until the disk fills — that number decides urgency. Only consider it handled once rotation has been SEEN to trigger (force it once) and the math confirms the disk can't fill, and explain how each stream is capped rather than trusting that logs are 'probably small'.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #973\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}