Skip to content

Commit 62019f0

Browse files
author
Damien Dallimore
committed
fixes from testing
1 parent a813765 commit 62019f0

16 files changed

+50
-39
lines changed

.classpath

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
<classpathentry kind="lib" path="lib/httpcore-nio-4.4.1.jar"/>
2121
<classpathentry kind="lib" path="lib/log4j-api-2.3.jar"/>
2222
<classpathentry kind="lib" path="lib/log4j-core-2.3.jar"/>
23+
<classpathentry kind="lib" path="lib/log4j-slf4j-impl-2.3.jar"/>
2324
<classpathentry kind="output" path="classes"/>
2425
</classpath>

config/jdklogging.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ com.splunk.logging.jdk.handler.SplunkRawTCPHandler.dropEventsOnQueueFull=false
3333

3434
# Set the default logging level for new SplunkHECHandler instances
3535
com.splunk.logging.jdk.handler.SplunkHECHandler.level=INFO
36-
com.splunk.logging.jdk.handler.SplunkHECHandler.host=somehost
36+
com.splunk.logging.jdk.handler.SplunkHECHandler.host=localhost
3737
com.splunk.logging.jdk.handler.SplunkHECHandler.port=8088
38-
com.splunk.logging.jdk.handler.SplunkHECHandler.token=YOURTOKEN
38+
com.splunk.logging.jdk.handler.SplunkHECHandler.token=4DBFC24E-19A2-4D31-9055-2139C818DBDD
3939
com.splunk.logging.jdk.handler.SplunkHECHandler.https=false
4040
com.splunk.logging.jdk.handler.SplunkHECHandler.poolsize=1
4141
com.splunk.logging.jdk.handler.SplunkHECHandler.index=main
42-
com.splunk.logging.jdk.handler.SplunkHECHandler.source=foo
43-
com.splunk.logging.jdk.handler.SplunkHECHandler.sourcetype=bar
42+
com.splunk.logging.jdk.handler.SplunkHECHandler.source=jul
43+
com.splunk.logging.jdk.handler.SplunkHECHandler.sourcetype=test-data
4444
com.splunk.logging.jdk.handler.SplunkHECHandler.maxQueueSize=5MB
4545
com.splunk.logging.jdk.handler.SplunkHECHandler.dropEventsOnQueueFull=false
4646

config/log4j.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ log4j.appender.splunkrawtcp.layout.ConversionPattern=%m%n
4040

4141
# Send log events to a Splunk HEC Endpoint
4242
log4j.appender.splunkhec=com.splunk.logging.log4j.appender.SplunkHECAppender
43-
log4j.appender.splunkhec.host=somehost
43+
log4j.appender.splunkhec.host=localhost
4444
log4j.appender.splunkhec.port=8088
45-
log4j.appender.splunkhec.token=YOURTOKEN
45+
log4j.appender.splunkhec.token=4DBFC24E-19A2-4D31-9055-2139C818DBDD
4646
log4j.appender.splunkhec.https=false
4747
log4j.appender.splunkhec.poolsize=1
4848
log4j.appender.splunkhec.index=main
49-
log4j.appender.splunkhec.source=foo
50-
log4j.appender.splunkhec.sourcetype=bar
49+
log4j.appender.splunkhec.source=log4j-test
50+
log4j.appender.splunkhec.sourcetype=test-data
5151
log4j.appender.splunkhec.maxQueueSize=5MB
5252
log4j.appender.splunkhec.dropEventsOnQueueFull=false
5353
log4j.appender.splunkhec.layout=org.apache.log4j.PatternLayout
54-
log4j.appender.splunkhec.layout.ConversionPattern=%m%n
54+
log4j.appender.splunkhec.layout.ConversionPattern=%m
5555

5656

5757
#Console appender

config/log4j2.xml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,40 @@
88
<Appenders>
99

1010
<SplunkHECAppender name="splunkhec"
11-
token="YOUR TOKEN"
12-
host="somehost"
11+
token="4DBFC24E-19A2-4D31-9055-2139C818DBDD"
12+
host="localhost"
1313
port="8088"
1414
https="false"
1515
poolsize="1"
1616
index="main"
17-
source="foo"
18-
sourcetype="bar" >
17+
source="log4j2"
18+
sourcetype="test-data" >
1919

20-
<PatternLayout pattern="%m%n" />
20+
<PatternLayout pattern="%m" />
2121

2222
</SplunkHECAppender>
2323

24-
<Socket name="splunkrawtcp" protocol="TCP" host="ubuntu-splunk"
24+
<Socket name="splunkrawtcp" protocol="TCP" host="localhost"
2525
port="5151">
2626
<PatternLayout pattern="%m%n" />
2727
</Socket>
2828

29-
<Socket name="splunkrawudp" protocol="UDP" host="ubuntu-splunk"
30-
port="5152">
31-
<PatternLayout pattern="%m%n" />
32-
</Socket>
33-
34-
29+
<Socket name="splunkrawudp" protocol="UDP" host="localhost"
30+
port="5152">
31+
<PatternLayout pattern="%m%n" />
32+
</Socket>
33+
34+
<Failover name="failover_example" primary="splunkhec">
35+
<Failovers>
36+
<AppenderRef ref="splunkrawtcp" />
37+
</Failovers>
38+
</Failover>
39+
3540
<Console name="stdout" target="SYSTEM_OUT">
3641
<PatternLayout pattern="%m%n" />
3742
</Console>
3843

39-
<Failover name="failover_example" primary="splunkhec">
40-
<Failovers>
41-
<AppenderRef ref="splunkrawtcp" />
42-
</Failovers>
43-
</Failover>
44+
4445

4546
</Appenders>
4647

config/logback.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<!--Send log events to a Splunk REST endpoint-->
88
<appender name="splunkrest" class="com.splunk.logging.logback.appender.SplunkRestAppender">
99
<port>8089</port>
10-
<host>ubuntu-splunk</host>
10+
<host>localhost</host>
1111
<delivery>stream</delivery>
1212
<user>admin</user>
1313
<metaSourcetype>testing</metaSourcetype>
14-
<pass>sawasdee</pass>
14+
<pass>foo</pass>
1515
<maxQueueSize>5MB</maxQueueSize>
1616
<dropEventsOnQueueFull>false</dropEventsOnQueueFull>
1717
<metaSource>rest</metaSource>
@@ -43,17 +43,17 @@
4343
<!--Send log events to a Splunk HEC Endpoint-->
4444
<appender name="splunkhec" class="com.splunk.logging.logback.appender.SplunkHECAppender">
4545
<port>8088</port>
46-
<host>somehost</host>
47-
<token>YOUR TOKEN</token>
46+
<host>localhost</host>
47+
<token>4DBFC24E-19A2-4D31-9055-2139C818DBDD</token>
4848
<https>false</https>
4949
<poolsize>1</poolsize>
5050
<index>main</index>
51-
<source>foo</source>
52-
<sourcetype>bar</sourcetype>
51+
<source>logback</source>
52+
<sourcetype>test-data</sourcetype>
5353
<maxQueueSize>5MB</maxQueueSize>
5454
<dropEventsOnQueueFull>false</dropEventsOnQueueFull>
5555
<layout class="ch.qos.logback.classic.PatternLayout">
56-
<pattern>%m%n</pattern>
56+
<pattern>%m</pattern>
5757
<!-- optionally you can enrich the messages with formatting tokens from the logging framework
5858
<pattern>%d %m%n</pattern>
5959
<pattern>%m loglevel="%p"%n</pattern>

lib/log4j-slf4j-impl-2.0-beta9.jar

-22 KB
Binary file not shown.

lib/log4j-slf4j-impl-2.3.jar

22 KB
Binary file not shown.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<dependency>
7171
<groupId>org.apache.logging.log4j</groupId>
7272
<artifactId>log4j-slf4j-impl</artifactId>
73-
<version>2.0</version>
73+
<version>2.3</version>
7474
</dependency>
7575
<dependency>
7676
<groupId>org.slf4j</groupId>

releases/splunklogging-1.3.tar.gz

201 Bytes
Binary file not shown.

releases/splunklogging-jdk-1.3.tar.gz

65 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)