Skip to content

Commit b333555

Browse files
authored
logging: include ES logging front-end, wire to log4j back-end (elastic#373)
1 parent fd524b7 commit b333555

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ task importMinimalElasticsearch() {
411411
from(buildElasticsearchLocalDistro.lib) {
412412
include jarPackageNamed("elasticsearch")
413413
include jarPackageNamed("elasticsearch-core")
414+
include jarPackageNamed("elasticsearch-logging")
414415
include jarPackageNamed("elasticsearch-x-content")
415416
include jarPackageNamed("elasticsearch-geo")
416417
include jarPackageNamed("lucene-core")

src/main/java/co/elastic/logstash/filters/elasticintegration/EventProcessorBuilder.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.google.common.util.concurrent.Service;
2020
import com.google.common.util.concurrent.ServiceManager;
2121
import org.elasticsearch.client.RestClient;
22+
import org.elasticsearch.common.logging.LogConfigurator;
2223
import org.elasticsearch.logstashbridge.common.SettingsBridge;
2324
import org.elasticsearch.logstashbridge.core.IOUtilsBridge;
2425
import org.elasticsearch.logstashbridge.env.EnvironmentBridge;
@@ -49,6 +50,11 @@
4950
@SuppressWarnings("UnusedReturnValue")
5051
public class EventProcessorBuilder {
5152

53+
static {
54+
// wires through to log4j under the hood
55+
LogConfigurator.configureESLogging();
56+
}
57+
5258
static final Duration CACHE_MAXIMUM_AGE = Duration.ofHours(24);
5359
static final Duration CACHE_RELOAD_FREQUENCY = Duration.ofSeconds(60);
5460

0 commit comments

Comments
 (0)