@@ -123,10 +123,10 @@ component
123
123
* Runs on registration
124
124
*/
125
125
public LogstashAppender function onRegistration () output = false {
126
- try {
126
+ try {
127
127
ensureDataStream ();
128
128
variables ._dataStreamAssured = true ;
129
- } catch ( any e ){
129
+ } catch ( any e ) {
130
130
createObject ( " java" , " java.lang.System" ).err .println (
131
131
" Unable to create data stream. The attempt to communicate with the Elasticsearch server returned: #e .message # - #e .detail #. Your ability to log messages with this appender may be compromised."
132
132
);
@@ -138,11 +138,10 @@ component
138
138
* Write an entry into the appender.
139
139
*/
140
140
public void function logMessage ( required any logEvent ) output = false {
141
-
142
- if ( ! variables ._dataStreamAssured ){
141
+ if ( ! variables ._dataStreamAssured ) {
143
142
this .onRegistration ();
144
143
// skip out if there was a communication failure
145
- if ( ! variables ._dataStreamAssured ){
144
+ if ( ! variables ._dataStreamAssured ) {
146
145
return ;
147
146
}
148
147
}
@@ -151,8 +150,11 @@ component
151
150
152
151
try {
153
152
var document = newDocument ().new ( index = getProperty ( " dataStream" ), properties = logObj );
154
- if ( getProperty ( " async" ) ){
155
- variables .asyncManager .newFuture ().withTimeout ( getProperty ( " asyncTimeout" ) ).run ( () = > document .create () );
153
+ if ( getProperty ( " async" ) ) {
154
+ variables .asyncManager
155
+ .newFuture ()
156
+ .withTimeout ( getProperty ( " asyncTimeout" ) )
157
+ .run ( () = > document .create () );
156
158
} else {
157
159
document .create ();
158
160
}
@@ -166,12 +168,12 @@ component
166
168
extraInfo = { " logData" : logObj , " exception" : e },
167
169
category = e .type
168
170
);
169
- var appendersMap = application .wirebox .getLogbox ().getAppenderRegistry ();
171
+ var appendersMap = application .wirebox .getLogbox ().getAppenderRegistry ();
170
172
// Log errors out to other appenders besides this one
171
173
appendersMap
172
174
.keyArray ()
173
175
.filter ( function ( key ){
174
- return lcase ( key ) ! = lcase ( getName () );
176
+ return lCase ( key ) ! = lCase ( getName () );
175
177
} )
176
178
.each ( function ( appenderName ){
177
179
appendersMap [ appenderName ].logMessage ( eLogEvent );
@@ -366,7 +368,9 @@ component
366
368
if ( propertyExists ( " lifecyclePolicy" ) ) {
367
369
policyBuilder .setPhases ( getProperty ( " lifecyclePolicy" ) );
368
370
} else {
369
- policyBuilder .hotPhase ( rollover = getProperty ( " rolloverSize" ) ).withDeletion ( age = getProperty ( " retentionDays" ) );
371
+ policyBuilder
372
+ .hotPhase ( rollover = getProperty ( " rolloverSize" ) )
373
+ .withDeletion ( age = getProperty ( " retentionDays" ) );
370
374
}
371
375
372
376
policyBuilder .save ();
@@ -407,7 +411,9 @@ component
407
411
],
408
412
" data_stream" : {},
409
413
" priority" : getProperty ( " indexTemplatePriority" ),
410
- " _meta" : { " description" : " Index Template for cbElasticsearch Logs ( DataStream: #dataStreamName # )" }
414
+ " _meta" : {
415
+ " description" : " Index Template for cbElasticsearch Logs ( DataStream: #dataStreamName # )"
416
+ }
411
417
}
412
418
);
413
419
@@ -645,7 +651,7 @@ component
645
651
" dynamic_templates" : [
646
652
{
647
653
" user_info_fields" : {
648
- " path_match" : " user.info.*" ,
654
+ " path_match" : " user.info.*" ,
649
655
" match_mapping_type" : " string" ,
650
656
" mapping" : {
651
657
" type" : " text" ,
@@ -682,17 +688,11 @@ component
682
688
},
683
689
" error" : {
684
690
" type" : " object" ,
685
- " properties" : {
686
- " extrainfo" : { " type" : " text" }
687
- }
691
+ " properties" : { " extrainfo" : { " type" : " text" } }
688
692
},
689
693
" message" : {
690
694
" type" : " text" ,
691
- " fields" : {
692
- " keyword" : {
693
- " type" : " keyword" , " ignore_above" : 512
694
- }
695
- }
695
+ " fields" : { " keyword" : { " type" : " keyword" , " ignore_above" : 512 } }
696
696
},
697
697
" event" : {
698
698
" type" : " object" ,
@@ -709,7 +709,7 @@ component
709
709
" properties" : {
710
710
" signature" : { " type" : " keyword" },
711
711
" isSuppressed" : { " type" : " boolean" },
712
- " assignment" : { " type" : " keyword" }
712
+ " assignment" : { " type" : " keyword" }
713
713
}
714
714
}
715
715
}
0 commit comments