generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
758 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ment/src/test/java/io/quarkiverse/logging/splunk/LoggingSplunkNamedHandlerConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
Copyright (c) 2023 Amadeus s.a.s. | ||
Contributor(s): Kevin Viet, Romain Quinio, Yohann Puyhaubert (Amadeus s.a.s.) | ||
*/ | ||
package io.quarkiverse.logging.splunk; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import org.jboss.logging.Logger; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import static org.mockserver.model.JsonBody.json; | ||
|
||
class LoggingSplunkNamedHandlerConfigTest extends AbstractMockServerTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest unitTest = new QuarkusUnitTest() | ||
.withConfigurationResource("application-splunk-logging-named-handler.properties") | ||
.withConfigurationResource("mock-server.properties") | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)); | ||
|
||
static final Logger logger = Logger.getLogger(LoggingSplunkNamedHandlerConfigTest.class); | ||
|
||
static final Logger monitoringLogger = Logger.getLogger("monitoring"); | ||
|
||
@Test | ||
void indexWithDefaultLoggerAndNamedLogger() { | ||
logger.warn("hello splunk"); | ||
monitoringLogger.info("{\"key\":\"value\"}"); | ||
awaitMockServer(); | ||
httpServer.verify(requestToJsonEndpoint() | ||
.withBody(json("{ index: 'mylogindex'}")) | ||
.withHeader("Authorization", "Splunk 12345678-1234-1234-1234-1234567890AB")); | ||
httpServer.verify(requestToJsonEndpoint() | ||
.withBody(json("{ index: 'mystatsindex'}")) | ||
.withHeader("Authorization", "Splunk 12345678-0000-0000-0000-1234567890AB")); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
deployment/src/test/resources/application-splunk-logging-named-handler.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
quarkus.log.handler.splunk.token=12345678-1234-1234-1234-1234567890AB | ||
quarkus.log.handler.splunk.level=WARN | ||
quarkus.log.handler.splunk.format=%s%e | ||
quarkus.log.handler.splunk.metadata-index=mylogindex | ||
quarkus.log.handler.splunk."MONITORING".url=http://localhost:8088 | ||
quarkus.log.handler.splunk."MONITORING".token=12345678-0000-0000-0000-1234567890AB | ||
quarkus.log.handler.splunk."MONITORING".level=INFO | ||
quarkus.log.handler.splunk."MONITORING".metadata-index=mystatsindex | ||
quarkus.log.category."monitoring".handlers=MONITORING | ||
quarkus.log.category."monitoring".use-parent-handlers=false |
412 changes: 412 additions & 0 deletions
412
docs/modules/ROOT/pages/includes/quarkus-log-handler-splunk.adoc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
quarkus.log.handler.splunk.url=https://localhost:8099 | ||
quarkus.log.handler.splunk.index=main | ||
quarkus.log.handler.splunk.metadata-index=main | ||
quarkus.log.handler.splunk.token=29fe2838-cab6-4d17-a392-37b7b8f41f75 | ||
quarkus.log.handler.splunk.batch-interval=1s | ||
quarkus.log.handler.splunk.disable-certificate-validation=true | ||
quarkus.log.console.enable=true | ||
quarkus.log.handler.splunk.serialization=nested | ||
quarkus.log.handler.splunk.serialization=nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.