Add splunk logging (#725)

* Add splunk logging

Co-Authored-By: Siegfried Puchbauer <siegfried.puchbauer@gmail.com>
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Explicitly declare we rely on EPL 1.0 in our dependency to logback

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

Co-authored-by: Siegfried Puchbauer <siegfried.puchbauer@gmail.com>
pull/753/head
Antoine Toulme 5 years ago committed by GitHub
parent 8ededd7a35
commit ef5a465d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      besu/build.gradle
  2. 40
      besu/src/main/resources/log4j2.xml
  3. 2
      build.gradle
  4. 9
      gradle/check-licenses.gradle
  5. 2
      gradle/versions.gradle

@ -65,6 +65,7 @@ dependencies {
implementation 'org.springframework.security:spring-security-crypto' implementation 'org.springframework.security:spring-security-crypto'
runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
runtimeOnly 'com.splunk.logging:splunk-library-javalogging'
testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts') testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts')
testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts') testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts')

@ -1,16 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO"> <Configuration status="INFO">
<Properties> <Properties>
<Property name="root.log.level">INFO</Property> <Property name="root.log.level">${env:LOG_LEVEL:-INFO}</Property>
<Property name="root.log.logger">${env:LOGGER:-Console}</Property>
<Property name="host">${env:HOST:-${docker:containerId:-localhost}}</Property>
<Property name="splunk.url">${env:SPLUNK_URL}</Property>
<Property name="splunk.token">${env:SPLUNK_TOKEN}</Property>
<Property name="splunk.index">${env:SPLUNK_INDEX}</Property>
<Property name="splunk.source">${env:SPLUNK_SOURCE:-besu}</Property>
<Property name="splunk.sourcetype">${env:SPLUNK_SOURCETYPE:-besu}</Property>
<Property name="splunk.batch_size_bytes">${env:SPLUNK_BATCH_SIZE_BYTES:-65536}</Property>
<Property name="splunk.batch_size_count">${env:SPLUNK_BATCH_SIZE_COUNT:-1000}</Property>
<Property name="splunk.batch_interval">${env:SPLUNK_BATCH_INTERVAL:-500}</Property>
<Property name="splunk.disableCertificateValidation">${env:SPLUNK_SKIPTLSVERIFY:-false}</Property>
</Properties> </Properties>
<Appenders> <Appenders>
<Console name="Console" target="SYSTEM_OUT"> <Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSSZZZ} | %t | %-5level | %c{1} | %msg%n" /> </Console> <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSSZZZ} | %t | %-5level | %c{1} | %msg%n" />
</Console>
<SplunkHttp name="Splunk"
url="${sys:splunk.url}"
token="${sys:splunk.token}"
host="${sys:host}"
index="${sys:splunk.index}"
source="${sys:splunk.source}"
sourcetype="${sys:splunk.sourcetype}"
messageFormat="text"
batch_size_bytes="${sys:splunk.batch_size_bytes}"
batch_size_count="${sys:splunk.batch_size_count}"
batch_interval="${sys:splunk.batch_interval}"
disableCertificateValidation="${sys:splunk.disableCertificateValidation}">
<PatternLayout pattern="%msg"/>
</SplunkHttp>
<Routing name="Router">
<Routes pattern="$${sys:root.log.logger}">
<Route ref="Console" key="Console" />
<Route ref="Splunk" key="Splunk" />
</Routes>
</Routing>
</Appenders> </Appenders>
<Loggers> <Loggers>
<Root level="${sys:root.log.level}"> <Root level="${sys:root.log.level}">
<AppenderRef ref="Console" /> <AppenderRef ref="Router" />
</Root> </Root>
</Loggers> </Loggers>
</Configuration> </Configuration>

@ -124,7 +124,7 @@ allprojects {
mavenCentral() mavenCentral()
mavenLocal() mavenLocal()
maven { url "https://consensys.bintray.com/pegasys-repo" } maven { url "https://consensys.bintray.com/pegasys-repo" }
maven { url "https://repository.apache.org/content/repositories/snapshots/" } maven { url "https://repo.spring.io/libs-release" }
} }
dependencies { errorprone "com.google.errorprone:error_prone_core" } dependencies { errorprone "com.google.errorprone:error_prone_core" }

@ -58,6 +58,7 @@ downloadLicenses {
reportByLicenseType = true reportByLicenseType = true
dependencyConfiguration = 'testCompile' dependencyConfiguration = 'testCompile'
ext.epl1 = license('Eclipse Public License 1.0', 'https://www.eclipse.org/legal/epl-v10.html')
ext.apache = license('Apache License, Version 2.0', 'http://opensource.org/licenses/Apache-2.0') ext.apache = license('Apache License, Version 2.0', 'http://opensource.org/licenses/Apache-2.0')
ext.mit = license('MIT License', 'http://www.opensource.org/licenses/mit-license.php') ext.mit = license('MIT License', 'http://www.opensource.org/licenses/mit-license.php')
ext.bsd = license('BSD License', 'http://www.opensource.org/licenses/bsd-license.php') ext.bsd = license('BSD License', 'http://www.opensource.org/licenses/bsd-license.php')
@ -65,6 +66,10 @@ downloadLicenses {
ext.cddl = license('Common Development and Distribution License 1.0', 'http://opensource.org/licenses/CDDL-1.0') ext.cddl = license('Common Development and Distribution License 1.0', 'http://opensource.org/licenses/CDDL-1.0')
ext.cc0 = license('Public Domain (CC0) License 1.0', 'https://creativecommons.org/publicdomain/zero/1.0') ext.cc0 = license('Public Domain (CC0) License 1.0', 'https://creativecommons.org/publicdomain/zero/1.0')
aliases = [ aliases = [
(epl1) : [
'Eclipse Public License - v 1.0',
'Eclipse Public License 1.0',
],
(apache) : [ (apache) : [
'The Apache Software License, Version 2.0', 'The Apache Software License, Version 2.0',
'The Apache Software License, version 2.0', 'The Apache Software License, version 2.0',
@ -108,6 +113,10 @@ downloadLicenses {
// RocksDB is dual licensed under Apache v2.0 and GPL 2 licenses // RocksDB is dual licensed under Apache v2.0 and GPL 2 licenses
// Explicitly declare that we are using the Apache v2.0 license // Explicitly declare that we are using the Apache v2.0 license
(group('org.rocksdb')) : apache, (group('org.rocksdb')) : apache,
// Logback is dual licensed under EPL v1.0 and LGPL v2.1
// Explicitly declare that we are using the EPL v1.0 license
(group('ch.qos.logback')) : epl1,
] ]
} }

@ -30,6 +30,8 @@ dependencyManagement {
dependency 'com.graphql-java:graphql-java:13.0' dependency 'com.graphql-java:graphql-java:13.0'
dependency 'com.splunk.logging:splunk-library-javalogging:1.8.0'
dependency 'com.squareup.okhttp3:okhttp:4.2.2' dependency 'com.squareup.okhttp3:okhttp:4.2.2'
dependency 'commons-cli:commons-cli:1.4' dependency 'commons-cli:commons-cli:1.4'

Loading…
Cancel
Save