Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/bernierllc/agents-environment-configWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/bernierllc/agents-environment-config/logging)<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/logging"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/logging/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/logging"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/logging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00506 |
| Opus 5.5 | $0.00000 | $0.00202 |
| Sonnet 5.5 | $0.00000 | $0.00101 |
| Haiku 4.5 | $0.00000 | $0.00051 |
Grade A, and why
logging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Logging Standards
Logger Usage
Use Logger Factory
Use @lib/logger-factory for auditLogger, systemLogger, or browserLogger instead of console.log.
Logger Types
auditLogger
- Usage: API routing ONLY
- Output: Writes to
audit_logdatabase table - When: For tracking API requests and user actions
import { auditLogger } from '@/lib/logger-factory';
export const POST = async (request: NextRequest) => {
auditLogger.info('API request received', { endpoint: '/api/users' });
// Implementation
};
browserLogger
- Usage: Browser context ONLY
- Output: Writes to browser console
- When: For client-side debugging and development
import { browserLogger } from '@/lib/logger-factory';
browserLogger.info('Component mounted', { component: 'UserCard' });
systemLogger
- Usage: Everywhere else (server-side, background jobs, etc.)
- Output: Writes to log file
- When: For general application logging
import { systemLogger } from '@/lib/logger-factory';
systemLogger.error('Database connection failed', { error });
Logging Best Practices
Log Levels
- Use appropriate log levels (debug, info, warn, error)
- Log errors with context
- Log important business events
- Avoid logging sensitive data
Log Context
- Include relevant context in log messages
- Use structured logging when possible
- Include request IDs for tracing
- Log performance metrics when appropriate
Prohibited Patterns
❌ NEVER DO:
- Use
console.login production code - Log sensitive data (passwords, tokens, PII)
- Log full request/response bodies
- Use console methods directly
✅ ALWAYS DO:
- Use appropriate logger from logger-factory
- Log only metadata and non-sensitive information
- Use structured logging with context
- Follow logging standards for each environment
References
- Security: See
general/security.mdc - Error Handling: See
topics/quality/error-handling.mdc
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 84 lines · 0 tokens per session scan A 71667ffc6bc7
logging is a cursor rule published in the GitHub repository bernierllc/agents-environment-config (11 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 506 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
architecture
agent-inspect architecture and product context.
016-deep-debugging
016: Deep log analysis approach for root cause debugging.
5-bug-finder
APPLY WHEN investigating a bug.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.