gorm-logger

Configure GORM logging with customizable levels and slow-query detection.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-logger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gorm-logger
Source: https://github.com/liurida/gorm-development-skill/tree/main/logger
Command: npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-logger

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

GORM's default logger can be noisy or insufficient, making it difficult to monitor SQL activity, detect slow queries, and keep sensitive data out of logs.

Core Features & Use Cases

  • Customizable log levels ranging from silent to full informational output.
  • Slow‑query detection with configurable thresholds.
  • Parameterized query logging to avoid exposing sensitive values.
  • Integration with external logging frameworks such as Zap or Logrus.
  • Context‑aware logging for tracing requests across services.

Quick Start

Ask the skill to configure GORM with a warning level logger that writes to standard output.

Frequently Asked Questions about gorm-logger

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

FAQPage Schema
How do I configure GORM logging to capture SQL statements and warnings in Go?

Configure GORM logging by applying a custom logger to your Go application to capture SQL statements, warnings, and errors. You can set customizable log levels ranging from silent to full informational output to control verbosity.

How do I detect slow queries using GORM in a Go application?

Detect slow queries in GORM by enabling slow-query detection with configurable thresholds. This allows you to monitor SQL activity and identify performance bottlenecks by logging queries that exceed your specified time limit.

Can I integrate GORM logging with external logging frameworks like Zap or Logrus?

Yes, you can integrate GORM logging with external logging frameworks such as Zap or Logrus. This satisfies requirements for incorporating SQL logs into your existing application logging infrastructure.

How do I prevent sensitive data from appearing in GORM SQL logs?

Prevent sensitive data exposure by using parameterized query logging. This feature avoids exposing sensitive values in your logs while still capturing the SQL statements and query structure for monitoring.

Does GORM logging support context-aware tracing for requests across services?

Yes, GORM logging supports context-aware logging for tracing requests across services. This allows you to attach context to SQL logs, enabling better observability for distributed Go applications.

How do I adjust GORM log verbosity per environment?

Adjust GORM log verbosity per environment by utilizing customizable log levels. You can configure the logger to be silent in production while outputting full informational SQL statements in development.