nerdexam
Broadcom-VMware

2V0-72.22PSE · Question #62

How can auditing be enabled for Spring Boot Actuator?

The correct answer is D. None of the above. D is correct because Spring Boot Actuator auditing is automatically enabled by auto-configuration when Spring Security is on the classpath - no explicit opt-in is required. Spring Boot's AuditAutoConfiguration kicks in and registers an InMemoryAuditEventRepository without any…

Microservices

Question

How can auditing be enabled for Spring Boot Actuator?

Options

  • AThe @EnableAuditing annotation
  • BSetting the property actuator.audit.enabled=true
  • CDeclaring a bean of type AuditEventRepository
  • DNone of the above.

How the community answered

(22 responses)
  • A
    14% (3)
  • B
    36% (8)
  • C
    5% (1)
  • D
    45% (10)

Explanation

D is correct because Spring Boot Actuator auditing is automatically enabled by auto-configuration when Spring Security is on the classpath - no explicit opt-in is required. Spring Boot's AuditAutoConfiguration kicks in and registers an InMemoryAuditEventRepository without any developer action, wiring up authentication success/failure events out of the box.

Why the distractors fail:

  • A (@EnableAuditing) belongs to Spring Data's JPA entity auditing (tracking @CreatedDate, @LastModifiedBy, etc.) - a completely separate feature with no connection to Actuator.
  • B (actuator.audit.enabled=true) is fabricated; this property does not exist in Spring Boot's auto-configuration.
  • C is the trickiest: while AuditEventRepository is the central interface for audit storage, you don't need to declare one yourself - Spring Boot auto-registers an InMemoryAuditEventRepository for you. Declaring your own bean overrides the default (e.g., to persist to a database), but it's not required to enable auditing.

Memory tip: When you see "enable X in Spring Boot," think auto-configuration first. Spring Boot's philosophy is convention over configuration - if something works out of the box (like audit events with Spring Security present), the correct answer is often "do nothing," making "None of the above" a trap-busting choice on exams.

Topics

#Spring Boot Actuator#Auditing Configuration#Observability#Production Monitoring

Community Discussion

No community discussion yet for this question.

Full 2V0-72.22PSE Practice