log-record
log-record is a Spring Boot annotation-based library for recording operation logs without intruding into business logic. It uses SpEL expressions to extract data from method parameters, supports custom functions and context, entity diffing, and can pipe logs to RabbitMQ, RocketMQ, or Spring Cloud Stream.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | qqxx6661/log-record |
| Owner | qqxx6661 |
| Primary language | Java |
| License | Apache-2.0 — OSI-approved |
| Stars | 1.1k |
| Forks | 195 |
| Open issues | 11 |
| Latest release | v1.7.1 (2025-07-26) |
| Last updated | 2025-07-26 |
| Source | https://github.com/qqxx6661/log-record |
What log-record is
Provides aspect-oriented logging via @OperationLog annotation with SpEL expression evaluation, custom function registration, conditional logging, multi-message-queue backend support (RabbitMQ, RocketMQ, Spring Cloud Stream), entity Diff comparison, and non-invasive context binding through LogRecordContext.
Get the log-record source
Clone the repository and explore it locally.
git clone https://github.com/qqxx6661/log-record.gitcd log-record# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- SpEL expressions are evaluated at runtime; malformed expressions will fail gracefully but must be tested—no compile-time validation. Use static strings where possible to reduce surface area.
- Custom functions must be registered before aspect initialization; function dependencies (e.g., database queries) must handle their own transaction/connection lifecycle to avoid deadlocks.
- LogRecordContext uses ThreadLocal storage; in async/reactive code paths (CompletableFuture, WebFlux), context may not propagate—manually pass context or wrap async calls.
- Entity Diff comparison is reflection-based; large object graphs or circular references can cause performance degradation or stack overflow. Test with your actual entity sizes.
- Message queue integration (RabbitMQ, RocketMQ) requires external infrastructure; connection failures are handled via retry SPI, but production deployments need monitoring and dead-letter queues.
When to avoid it — and what to weigh
- Require Real-Time Guaranteed Delivery — Async logging via thread pool; if a log write fails, retry logic and SPI fallback exist, but messages can be lost if infrastructure crashes. Not suitable for financial transaction records requiring 100% durability guarantees.
- Simple Logging Without Dynamic Context — If you only need static log statements (e.g., 'user logged in'), standard SLF4J is simpler and has less runtime overhead. SpEL evaluation and context binding add latency for trivial use cases.
- Lightweight Microservices or Embedded Systems — Introduces Spring Boot dependency, aspect weaving, and SpEL runtime evaluation. Not ideal for projects minimizing framework overhead or running on resource-constrained environments.
- High-Volume Log Ingestion Without Batching — Library sends logs individually to message queues; no built-in batching. For extremely high-frequency operations, consider pre-aggregation or batch collection layers.
License & commercial use
Licensed under Apache License 2.0, a permissive OSI-approved license allowing commercial use, modification, and distribution with attribution and liability limitations.
Apache-2.0 is a well-established permissive license compatible with most commercial products. No proprietary restrictions on using log-record in closed-source or for-profit applications. Legal review recommended for mission-critical deployments to confirm compliance with your liability and indemnification policies.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
SpEL expressions parsed at runtime—only allow trusted annotation values; do not dynamically build expressions from user input to prevent SpEL injection. LogRecordContext uses ThreadLocal; ensure no sensitive context (passwords, tokens) is logged. Async log processing may expose logs in flight; encrypt message queue channels if logging PII. No explicit mention of secret redaction or field masking.
Alternatives to consider
mzt-biz-log (Meituan original)
Original inspiration source cited in README; if you require Meituan's exact implementation or ongoing Meituan-specific support, use that. log-record is a community reimplementation with additional features.
Spring AOP + Custom Aspect with SLF4J
Manual but minimal-dependency alternative if SpEL and context binding are overkill. Lower learning curve, no message queue coupling, but requires writing boilerplate aspect and context handling code.
Apache Commons Audit / AuditJ
Dedicated audit logging libraries with built-in compliance features (e.g., tamper detection). Heavier but stronger guarantees for regulated industries if log-record's async-first design is insufficient.
Build on log-record with DEV.co software developers
Add one dependency and start logging operations with clean annotations. Connect to your message queue, database, or analytics platform in minutes. No business code changes required.
Talk to DEV.coRelated on DEV.co
Explore the category and the services that help you build with it.
log-record FAQ
Does log-record block my business logic if the logger fails?
Can I use log-record with non-Spring Boot projects?
How do I log PII safely?
What happens if my RabbitMQ broker is down?
Work with a software development agency
Adopting log-record is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source observability software in production.
Integrate Audit Logging into Your Spring Boot App
Add one dependency and start logging operations with clean annotations. Connect to your message queue, database, or analytics platform in minutes. No business code changes required.