Show HN: Intelligent Log Sanitization and logs to metrics LogGuardAI, a Log4j2 plugin that automatically detects and masks sensitive data in Java logs using rule-based analysis and AI, has been released on May 27, 2026. The tool supports 20+ sensitive keyword detection, smart risk scoring, and logs-to-metrics extraction for Prometheus-style monitoring, with AI-powered sanitization via OpenAI, Anthropic Claude, or Azure OpenAI. Intelligent Log Sanitization for Java — Automatically detect and mask sensitive data in logs using rule-based analysis and AI. LogGuardAI is a Log4j2 plugin that intercepts log events and intelligently sanitizes them to prevent accidental exposure of sensitive data like passwords, API keys, tokens, and personal information. It also supports logs-to-metrics extraction for Log4j2, converting log lines into Prometheus-style metrics using custom regex patterns. ❌ Logs with secrets: LOG User auth: userId=12345 apiKey=sk-abcdef123456 password=secret ↑ Oops Now this secret is in logs, monitoring dashboards, and backups ✅ Logs with LogGuardAI: LOG User auth: userId= apiKey= password= ↑ Secrets automatically masked, structure preserved - 🔐 20+ Sensitive Keyword Detection — Automatically detects passwords, tokens, API keys, etc. - 📊 Smart Risk Scoring — Multi-factor analysis keywords, patterns, entropy - ⚡ Lightning Fast — <5ms latency, non-blocking design - 🛡️ Fail-Safe — Logging never breaks, even if something fails - 📝 Structured Data Support — Handles key=value, JSON, query strings - 🧠 AI-Powered Sanitization — OpenAI GPT-based intelligent masking with context - 💰 LRU Caching — 80-95% cache hit rate = 80% cost savings - 🏆 Enhanced Exceptions — AI explains what went wrong - 🔍 Data Classification — Automatically identify PII vs. sensitive data - 📊 Configurable Sampling — Control AI costs 5%-100% - 📦 Batch AI Processing — Process multiple sensitive values together 5x efficiency - ⚡ Async/Non-Blocking — AI calls never block log threads <5ms guaranteed - 🔄 Smart Fallbacks — Rule-based masking if AI fails or times out - 🐛 Spring Boot Compatibility — Fixed Log4j2 plugin registration issues - 🤖 Multi-Provider AI — OpenAI, Anthropic Claude, or Azure OpenAI - 🏗️ Anthropic Claude Integration — Claude 3 models with Messages API - ☁️ Azure OpenAI Integration — Custom endpoints and deployments - 🔧 Provider-Specific Configuration — Azure endpoints, deployments, API versions - 🏷️ Enhanced Model Support — GPT-4, Claude 3, Azure deployments - 📊 Configurable Batch Size — Tune performance vs. API efficiency - 🤖 Multi-Provider Support — OpenAI, Anthropic Claude, Azure OpenAI - 📈 Metrics Extraction — Convert legacy unstructured logs into rich JSON metrics. - 🏗️ Backward Compatible — Existing configurations work unchanged Released: May 27, 2026 - 📊 Pattern-Based Metrics — Define custom regex patterns to extract metrics directly from logs - 🎯 User-Defined Patterns — Create metrics for HTTP requests, FTP transfers, database queries, etc. - 💾 Append-Only File — Metrics stored in Prometheus text format with cumulative history - 📈 Logs-to-Metrics Conversion — Convert Log4j2 log entries into counters and labels for monitoring and alerting - ⚙️ Periodic Flushing — Configurable flush interval default: 60 seconds - 🔐 Cardinality Protection — Configurable limits prevent unbounded metric combinations default: 10,000 - 🔌 Zero Dependencies — No external monitoring infrastructure required