frappe-core-logging

Configure Frappe logging and error tracking with frappe.logger() and frappe.log_error().

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-core-logging-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-core-logging
Source: https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/core/frappe-core-logging
Command: npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-core-logging-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents silent production failures and debugging dead-ends by guiding correct Frappe logging and error-tracking patterns so administrators can reliably see, trace, and diagnose issues.

Core Features & Use Cases

  • Application logging with frappe.logger(): Create module-specific rotating log files under sites/{site}/logs/ for traceable operational visibility.
  • Admin-visible error tracking with frappe.log_error(): Persist exceptions into the Error Log DocType for Desk UI review and querying.
  • Production request and performance monitoring: Enable HTTP request logging and per-request metrics via enable_frappe_logger and monitor in site_config.json.
  • External error tracking via Sentry: Capture unhandled exceptions by setting FRAPPE_SENTRY_DSN and optional profiling/DB monitoring environment variables.
  • Safety guardrails: Avoid common anti-patterns like print() usage, positional log_error() arguments that can swap fields, and leaking sensitive tokens/passwords into logs.

Quick Start

Use the frappe-core-logging skill to implement production-grade logging and error tracking in your Frappe app without relying on print statements.

Frequently Asked Questions about frappe-core-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I log errors in Frappe so they show up in the Desk UI?

To log errors in Frappe for admin visibility, use frappe.log_error() with keyword arguments. This persists exceptions into the Error Log DocType, allowing administrators to review and query production issues directly from the Desk UI.

What is the correct way to set up application logging with frappe.logger()?

Frappe logging requires creating module-named loggers using frappe.logger(). This generates rotating log files under sites/{site}/logs/, ensuring traceable operational visibility by separating logs by module name.

How do I enable HTTP request logging and performance monitoring in Frappe?

Enable HTTP request logging and per-request metrics in Frappe by setting enable_frappe_logger and monitor flags to true in site_config.json. This captures production request data for performance monitoring.

Can I integrate Sentry for external error tracking in a Frappe application?

Yes, you can capture unhandled exceptions in Frappe via Sentry by setting the FRAPPE_SENTRY_DSN environment variable. Optional environment variables also enable profiling and database monitoring.

Why should I avoid positional arguments in frappe.log_error()?

Using positional arguments in frappe.log_error() can swap fields and corrupt error tracking data. You should use keyword arguments instead to ensure exceptions persist correctly into the Error Log DocType.

What safety precautions should I take when implementing production logging in Frappe?

When implementing Frappe logging, avoid print() usage and ensure secure handling to prevent leaking sensitive tokens or passwords into logs. Use module-named loggers and appropriate site_config.json flags like disable_error_snapshot.