Skip to content

Latest commit

Β 

History

History
65 lines (41 loc) Β· 2.22 KB

File metadata and controls

65 lines (41 loc) Β· 2.22 KB

Logging Best Practices β€” Instruction ReadMe 🧾

Status: Draft (pink badge)

"Whether you’re flying solo or under the protection of The Logfather, this one’s got your back."

This instruction file provides a clean, reusable summary of application logging best practices β€” designed for use with Copilot’s editFiles and readFiles capabilities.

Originally crafted as a companion to The Logfather, it provides opinionated but practical guidance for improving structured logging, log level usage, runtime configuration, and secure output β€” all without requiring infrastructure changes or external dependencies.


Designed for... 🀝

  • The Logfather agent β€” for automated agent-driven logging audits and fixes
  • Manual use β€” by developers who want to up their observability game
  • Copilot agent tasks β€” like logging linting, log upgrades, or secure log refactors

What It Covers ✨

  • βœ… JSON-structured logging best practices
  • βœ… Log level definitions and guidance
  • βœ… Context enrichment (trace IDs, modules, etc)
  • βœ… Runtime control of log levels
  • βœ… Secure log handling (no PII, no auth leaks)
  • βœ… Language-specific examples (Java, Python, JS)

How to Use πŸ“Ž

You can:

  • Drop this into any .instructions.md loader or reference it via #logging-best-practices.instructions.md
  • Bundle it with a agent like The Logfather
  • Invoke it directly inside a Copilot Agent or compatible AI tool
  • Upload as guide for GitHub Coding Agent

AI Behavior When Used 🧠

When loaded in context, Copilot should:

  • Recommend structured JSON log formats
  • Insert proper log levels based on context
  • Suggest central logger use (but not enforce setup)
  • Avoid business logic changes
  • Respect scoped paths or modules

Example Prompt πŸ“Ÿ

Please review this file using `#./instructions/logging-best-practices.instructions.md` and insert structured logs with appropriate levels.

🎩 Want it automatic? Pair it with The Logfather and let the capo handle it.


Generated with the help of ChatGPT as directed by Ashley Childress