diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3c291a8..c542c19 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,7 @@ +1.1 +--- +Added new Splunk SDK jar with TLS support + 1.0 --- Initial release \ No newline at end of file diff --git a/build/build.properties b/build/build.properties index a79617f..b70d9f9 100644 --- a/build/build.properties +++ b/build/build.properties @@ -1,4 +1,4 @@ -version=1.0 +version=1.1 src=src classes=classes diff --git a/config/jdklogging.properties b/config/jdklogging.properties index e17fef1..24b4447 100644 --- a/config/jdklogging.properties +++ b/config/jdklogging.properties @@ -1,8 +1,8 @@ #Example java.util.logging configuration using a Splunk REST Handler or Splunk Raw TCP Appender #handlers = java.util.logging.ConsoleHandler -handlers = com.splunk.logging.jdk.handler.SplunkRestHandler -#handlers = com.splunk.logging.jdk.handler.SplunkRawTCPHandler +#handlers = com.splunk.logging.jdk.handler.SplunkRestHandler +handlers = com.splunk.logging.jdk.handler.SplunkRawTCPHandler # Set the default logging level for the root logger .level = INFO @@ -25,8 +25,8 @@ com.splunk.logging.jdk.handler.SplunkRestHandler.dropEventsOnQueueFull=false # Set the default logging level for new SplunkRawTCPHandler instances com.splunk.logging.jdk.handler.SplunkRawTCPHandler.level=INFO -com.splunk.logging.jdk.handler.SplunkRawTCPHandler.host=localhost -com.splunk.logging.jdk.handler.SplunkRawTCPHandler.port=5150 +com.splunk.logging.jdk.handler.SplunkRawTCPHandler.host=somehost +com.splunk.logging.jdk.handler.SplunkRawTCPHandler.port=5151 com.splunk.logging.jdk.handler.SplunkRawTCPHandler.maxQueueSize=5MB com.splunk.logging.jdk.handler.SplunkRawTCPHandler.dropEventsOnQueueFull=false diff --git a/config/logback.xml b/config/logback.xml index 16ab6e1..b5d7e15 100644 --- a/config/logback.xml +++ b/config/logback.xml @@ -11,7 +11,7 @@ stream admin testing - splunk + sawasdee 5MB false rest @@ -28,7 +28,7 @@ 5151 - ubuntu-splunk + somehost 5MB false diff --git a/lib/splunk.jar b/lib/splunk.jar deleted file mode 100644 index 13f6753..0000000 Binary files a/lib/splunk.jar and /dev/null differ diff --git a/lib/splunk_tlsv12.jar b/lib/splunk_tlsv12.jar new file mode 100644 index 0000000..0426ac8 Binary files /dev/null and b/lib/splunk_tlsv12.jar differ diff --git a/releases/splunklogging-1.0.tar.gz b/releases/splunklogging-1.0.tar.gz index 424dcdd..b5b4d87 100644 Binary files a/releases/splunklogging-1.0.tar.gz and b/releases/splunklogging-1.0.tar.gz differ diff --git a/releases/splunklogging-1.1.tar.gz b/releases/splunklogging-1.1.tar.gz new file mode 100644 index 0000000..417e40f Binary files /dev/null and b/releases/splunklogging-1.1.tar.gz differ diff --git a/src/com/splunk/logging/SplunkRestInput.java b/src/com/splunk/logging/SplunkRestInput.java index e505825..b80f29e 100644 --- a/src/com/splunk/logging/SplunkRestInput.java +++ b/src/com/splunk/logging/SplunkRestInput.java @@ -72,6 +72,7 @@ public SplunkRestInput(String user, String pass, String host, int port, private void initService() { + System.setProperty("splunk.securetransport.protocol", "tls"); this.service = new Service(host, port); this.service.login(user, pass); this.receivers = service.getReceiver(); diff --git a/src/com/splunk/logging/log4j/appender/SplunkRawTCPAppender.java b/src/com/splunk/logging/log4j/appender/SplunkRawTCPAppender.java index a021f4d..5217a1b 100644 --- a/src/com/splunk/logging/log4j/appender/SplunkRawTCPAppender.java +++ b/src/com/splunk/logging/log4j/appender/SplunkRawTCPAppender.java @@ -62,6 +62,20 @@ protected void append(LoggingEvent event) { String formatted = layout.format(event); + //send error stack traces to splunk + if(layout.ignoresThrowable()) { + String[] s = event.getThrowableStrRep(); + StringBuilder stackTrace = new StringBuilder(); + if (s != null) { + int len = s.length; + for(int i = 0; i < len; i++) { + stackTrace.append(Layout.LINE_SEP); + stackTrace.append(s[i]); + } + } + formatted += stackTrace.toString(); + } + sri.streamEvent(formatted); }