Application Logs
Configure kPow Application Logs
kPow uses Logback to record application logs to stdout.
Switch to JSON formatted logs with the environment variableLOG_FORMAT=json
Configure kPow to write application logs to disk (or any other supported Logback appender) and control the log levels by providing a Logback configuration file.
Note: Kafka logging is verbose, we recommend tuning it to ERROR logs only.
This example turns on Jetty JAAS debug logging and writes logs to a file called kpow-log.txt:
1
<configuration>
2
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
3
<file>kpow-log.txt</file>
4
<append>true</append>
5
<encoder>
6
<pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{36} – %m%n</pattern>
7
</encoder>
8
</appender>
9
10
<logger name="org.eclipse.jetty.jaas" level="DEBUG"/>
11
<logger name="org.eclipse.jetty.security.authentication" level="DEBUG"/>
12
13
<root level="INFO">
14
<appender-ref ref="FILE"/>
15
</root>
16
</configuration>
Copied!
Provide your custom Logback configuration to kPow as a Java system variable:
1
java -Dlogback.configurationFile=/kpow/custom-logback.xml -jar /kpow/kpow-latest.jar
Copied!
The kPow Docker Container can be configured with the JAVA_TOOL_OPTIONS environment variable:
1
JAVA_TOOL_OPTIONS=-Dlogback.configurationFile=/kpow/custom-logback.xml
Copied!
In this specific example we turn on debug logging for Jetty JAAS authentication methods (LDAP, etc.).
To put JAAS into debug mode also requires debug="true" in your JAAS config file:
1
kpow {
2
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
3
debug="true"
4
file="dev-resources/jaas/hash-realm.properties";
5
};
Copied!
Once configured, application logs are written to file and JAAS debug output is visible:
1
09:26:32.135 INFO [oprtr.compute.snapshots.v2-44318b10-b719-46db-96ea-f97495cdce8f-StreamThread-2] operatr.compute-v2 – oprtr.compute.snapshots.v2: streams state changed from REBALANCING to RUNNING
2
09:26:32.287 INFO [oprtr.compute.metrics.v2-6126ee6c-0253-4a5d-8d66-cbd3b0a4b0bb-StreamThread-2] operatr.compute-v2 – oprtr.compute.metrics.v2: streams state changed from REBALANCING to RUNNING
3
09:26:39.349 INFO [OperatrScheduler_Worker-1] operatr.observe.kafka – R9AvkXfHTsCiI8g3E_5EVA: [9] configuration captured in 204 ms
4
09:26:39.605 INFO [OperatrScheduler_Worker-1] operatr.observe.kafka – R9AvkXfHTsCiI8g3E_5EVA: [9] configuration captured in 256 ms
5
09:26:41.409 DEBUG [qtp1357054363-56] o.e.j.j.spi.PropertyFileLoginModule – setupPropertyUserStore: Starting new PropertyUserStore. PropertiesFile: dev-resources/jaas/hash-realm.properties refreshInterval: 0
6
09:26:41.416 DEBUG [qtp1357054363-56] o.e.j.j.spi.PropertyFileLoginModule – Checking PropertyUserStore dev-resources/jaas/hash-realm.properties for admin
7
09:26:41.417 DEBUG [qtp1357054363-56] o.e.j.j.spi.PropertyFileLoginModule – Found: admin in PropertyUserStore dev-resources/jaas/hash-realm.properties
8
09:26:41.429 INFO [qtp1357054363-58] operatr.auth.jetty – login -> user: admin, roles: #{"content-administrators" "kafka-admins" "server-administrators"}
9
09:27:05.449 INFO [OperatrScheduler_Worker-3] operatr.observe.kafka – R9AvkXfHTsCiI8g3E_5EVA: [38] kafka telemetry snapshots captured in 440 ms
10
09:28:05.250 INFO [OperatrScheduler_Worker-7] operatr.observe.kafka – R9AvkXfHTsCiI8g3E_5EVA: [38] kafka telemetry snapshots captured in 243 ms
11
09:29:05.350 INFO [OperatrScheduler_Worker-1] operatr.observe.kafka – R9AvkXfHTsCiI8g3E_5EVA: [38] kafka telemetry snapshots captured in 343 ms
12
09:30:05.257 INFO [OperatrScheduler_Worker-5] operatr.observe.kafka – R9AvkXfHTsCiI8g3E_5EVA: [38] kafka telemetry snapshots captured in 250 ms
Copied!
See the Logback site for full information on configuration options like rolling file appenders.
Copy link