Skip to content

Commit

Permalink
add asyncTimeout and fix rollover size not being applied correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Nov 26, 2023
1 parent 5ce7c86 commit 9a87042
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

----
## [Unreleased]
### Added
* Added `asyncTimeout` setting with default of 5000ms

### Fixed
* Fixed rollover size not being applied correctly on the ILM policy

## [3.2.4] - 11-21-2023
### Fixed
Expand Down
8 changes: 5 additions & 3 deletions models/logging/LogstashAppender.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ component
"migrateIndices" : false,
// Whether to throw an error if an attempt to save a log entry fails
"throwOnError" : true,
"async" : false
"async" : false,
// Timeout, in ms, to allow async threads to exist - otherwise they default to 0
"asyncTimeout" : 5000
};

for ( var configKey in structKeyArray( instance.Defaults ) ) {
Expand Down Expand Up @@ -150,7 +152,7 @@ component
try {
var document = newDocument().new( index = getProperty( "dataStream" ), properties = logObj );
if( getProperty( "async" ) ){
variables.asyncManager.newFuture().run( () => document.create() );
variables.asyncManager.newFuture().withTimeout( getProperty( "asyncTimeout" ) ).run( () => document.create() );
} else {
document.create();
}
Expand Down Expand Up @@ -364,7 +366,7 @@ component
if ( propertyExists( "lifecyclePolicy" ) ) {
policyBuilder.setPhases( getProperty( "lifecyclePolicy" ) );
} else {
policyBuilder.withDeletion( age = getProperty( "retentionDays" ) );
policyBuilder.hotPhase( rollover=getProperty( "rolloverSize" ) ).withDeletion( age = getProperty( "retentionDays" ) );
}

policyBuilder.save();
Expand Down

0 comments on commit 9a87042

Please sign in to comment.