Skip to content

Conversation

@devondragon
Copy link
Owner

This pull request updates the conditional logic for enabling the FileAuditLogFlushScheduler component to provide more flexibility in configuration. The most important changes are:

Updates to conditional annotations:

  • Replaced @ConditionalOnProperty with @ConditionalOnExpression in FileAuditLogFlushScheduler to allow more complex conditions for enabling the scheduler. The new condition checks that user.audit.logEvents is true and user.audit.flushOnWrite is not true. (src/main/java/com/digitalsanctuary/spring/user/audit/FileAuditLogFlushScheduler.java, [1] [2]

…ConditionalOnExpression for improved flexibility
Copilot AI review requested due to automatic review settings May 7, 2025 18:40
@devondragon devondragon merged commit 8897553 into main May 7, 2025
2 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the conditional logic for enabling the FileAuditLogFlushScheduler component by replacing the @ConditionalOnProperty annotation with @ConditionalOnExpression.

  • Updated the import and annotation in FileAuditLogFlushScheduler
  • Adjusted the conditional expression to check that user.audit.logEvents is true and user.audit.flushOnWrite is not true

@Component
@RequiredArgsConstructor
@ConditionalOnProperty(name = "user.audit.flushOnWrite", havingValue = "false")
@ConditionalOnExpression("${user.audit.logEvents:true} && !${user.audit.flushOnWrite:true}")
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for user.audit.flushOnWrite is set to true in the expression, which means the scheduler will be disabled unless explicitly overridden. Consider revisiting the default values to ensure they align with the intended enablement behavior from the original configuration.

Suggested change
@ConditionalOnExpression("${user.audit.logEvents:true} && !${user.audit.flushOnWrite:true}")
@ConditionalOnExpression("${user.audit.logEvents:true} && !${user.audit.flushOnWrite:false}")

Copilot uses AI. Check for mistakes.
@devondragon devondragon deleted the issue-182-FileAuditLogFlushScheduler-logs-despite-logEvents-being-disabled branch October 26, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants