agentsclimarketplace

Logging

Skill iceflower/agent-skills/logging

Agent Skills 오픈 표준 기반 AI 코딩 에이전트용 스킬 컬렉션 (Java, Kotlin, Spring, NestJS, K8s, Terraform, GraphQL, gRPC, OpenTelemetry, a11y, i18n 등 60개)

Install
npx -y skills add iceflower/agent-skills --skill logging

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Logging standards, structured logging, and sensitive data handling. Covers log levels (DEBUG, INFO, WARN, ERROR, TRACE), MDC (Mapped Diagnostic Context), correlation ID propagation, log format standardization, sensitive data masking, and log aggregation best practices. Use when writing logging code, configuring log frameworks (Logback, Log4j2), reviewing log output, or implementing request tracing with correlation IDs.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.9 KB, as published. Nobody here has run it

Logging Rules

1. Log Level Usage

Level Definitions

LevelPurposeExamples
ERRORCritical issues needing attentionDB connection failed, payment error
WARNPotential problems, attentionDeprecated API call, retry in progress
INFOMajor business eventsUser login, order created
DEBUGDevelopment/debugging detailsVariable values, method entry/exit
TRACEVery detailed debugging infoFull call stack, timing info

Level Selection Criteria

ERROR: Service disruption or data loss possible
WARN: Normal operation but monitoring needed
INFO: Business flow tracking
DEBUG: Root cause analysis when issues occur
TRACE: Performance analysis or deep debugging

2. Log Message Format

Basic Structure

[timestamp] [level] [traceId] [class:method] - message {context}

Example

2024-01-15T10:30:45.123Z INFO [abc123] [UserService:login] - User login successful {"userId": "user-001", "ip": "192.168.1.1"}
2024-01-15T10:31:00.456Z ERROR [abc123] [PaymentService:process] - Payment failed {"orderId": "order-123", "errorCode": "INSUFFICIENT_BALANCE"}

Required Fields

FieldDescription
timestampISO 8601 format, UTC preferred
levelLog level
traceIdUnique ID for request tracing
locationClassName:methodName
messageHuman-readable message
contextAdditional context in JSON format

3. Sensitive Data Handling

Never Include in Logs

  • Passwords
  • API keys, secret keys
  • Access tokens, refresh tokens
  • Credit card numbers, CVV
  • National ID, passport numbers
  • Bank account numbers
  • Biometric data
  • Precise location data

Masking Rules

Data TypeMasking MethodExample
EmailFirst 2 chars + *** + @ + domainab***@example.com
PhoneMask middle 4 digits010-****-1234
NameFirst char + ***J***
Credit CardShow last 4 digits only****-****-****-1234
API KeyFirst 4 chars + ***sk-****...
AddressShow city/region onlySeoul ***
IP AddressMask last octet192.168.1.***

Masking Implementation Example

// Email masking
function maskEmail(email: string): string {
  const [localPart, domain] = email.split('@');
  const masked = localPart.slice(0, 2) + '***';
  return `${masked}@${domain}`;
}

// Phone masking
function maskPhone(phone: string): string {
  return phone.replace(/(\d{3})-(\d{4})-(\d{4})/, '$1-****-$3');
}

// Credit card masking
function maskCardNumber(cardNumber: string): string {
  const lastFour = cardNumber.slice(-4);
  return `****-****-****-${lastFour}`;
}

4. Structured Logging

JSON Log Format

{
  "timestamp": "2024-01-15T10:30:45.123Z",
  "level": "INFO",
  "traceId": "abc123",
  "service": "user-service",
  "class": "UserService",
  "method": "login",
  "message": "User login successful",
  "context": {
    "userId": "user-001",
    "loginMethod": "password",
    "durationMs": 150
  }
}

Context Information Inclusion

InfoIncludeNote
userIdYesNo masking needed
requestIdYesFor tracing
durationYesPerformance monitoring
stack traceYes (ERROR)Error debugging
passwordNoNever include
tokenNoNever include

5. Logging Anti-Patterns

Patterns to Avoid

// Bad: Exposing sensitive info
logger.info(`User login: ${email}, password: ${password}`);

// Good: Exclude sensitive info
logger.info(`User login successful`, { userId: user.id });

// Bad: Error log without stack trace
logger.error(`Payment failed: ${error.message}`);

// Good: Include stack trace
logger.error(`Payment failed`, { error: error.stack, orderId });

// Bad: Excessive DEBUG logs
logger.debug(`Processing item 1`);
logger.debug(`Processing item 2`);
// ... thousands of logs

// Good: Log in meaningful batches
logger.debug(`Processing batch`, { itemCount: items.length });

// Bad: Wrong log level usage
logger.error(`User not found: ${userId}`);  // Business exception, not ERROR

// Good: Appropriate level
logger.info(`User not found`, { userId });  // Or WARN

6. Performance Considerations

  • Disable DEBUG/TRACE in production by default
  • Log in batches for large data processing
  • Always mask sensitive info regardless of log level
  • Use structured logs (JSON) for efficient searching

Log Volume Guidelines

EnvironmentINFO+DEBUGTRACE
DevelopmentYesYesYes
StagingYesYesNo
ProductionYesNoNo

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.