java-exception-logging

Enforce error-code, exception-handling, and SLF4J logging standards for Java applications.

44|15|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/yanhaoluo0/AlibabaDevelopmentManualSkills --skill java-exception-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-exception-logging
Source: https://github.com/yanhaoluo0/AlibabaDevelopmentManualSkills/tree/main/.cursor/skills/java-exception-logging
Command: npx skills add https://github.com/yanhaoluo0/AlibabaDevelopmentManualSkills --skill java-exception-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

阿里巴巴Java开发手册异常日志规约,帮助团队统一错误码、异常处理和日志规范,提高定位问题的速度和代码可维护性。

Core Features & Use Cases

  • (一) 错误码设计原则和规范,确保错误来源可追溯、错误码格式统一、避免将错误码用于提示信息。
  • (二) 异常处理规范,强调不要将异常用于流程控制、避免吞掉异常、以及在需要时抛出对业务有意义的自定义异常。
  • (三) 日志规约,要求使用日志框架门面、日志留存和脱敏、以及在生产环境的日志级别与输出规范。

Quick Start

在你的项目中应用此规约,确保错误码、异常处理与日志规约符合标准。

Frequently Asked Questions about java-exception-logging

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

FAQPage Schema
What are the best practices for Java exception handling and logging in backend services?

Java exception handling best practices mandate standardizing error code design, preventing exceptions from controlling flow, and enforcing SLF4J-compatible log generation policies to improve traceability and maintainability.

How do I standardize error codes in a Java application?

Standardize Java error codes by enforcing uniform formatting and source traceability rules, strictly avoiding using error codes as user-facing prompt messages.

Why does swallowing exceptions cause problems in Java runtime error management?

Swallowing exceptions in Java runtime error management hides failures, prevents throwing meaningful custom business exceptions, and severely slows down issue localization during code reviews.

Does this logging standard work with SLF4J-compatible frameworks?

Yes, this logging standard fully supports SLF4J-compatible frameworks, enforcing log generation, data desensitization, and production log level rules across Java backend services.

What is the correct way to use logging levels in a Java production environment?

Correct Java production logging levels require enforcing strict output standards, applying data desensitization, and ensuring log retention using SLF4J-compatible framework facades.