conkw documentation - Troubleshooting

You've got this grabber you're trying to configure and it refuses to do what you want it to do. Here is the place where I will give you the tools to try and figure out what's wrong.

This all revolves around logging.

The log file for conkw is located in $CONKW_HOME/log/conkw.log. What will be logged and how is defined in two files:

$CONKW_HOME/config/config.jsonc

This is the config file. This is where you can define the log level of a specific grabber:

{
  "implementation":"net.pieroxy.conkw.webapp.grabbers.openweathermap.OpenWeatherMapGrabber",
  "logLevel":"FINE",
  "name":"paris_weather",
  "config": {
    "toExtract":["minute","hour","day","current"],
    "token":"abcdef1234567890",
    "lat":48.8534,
    "lon":2.3488
  }
},

Notice the property logLevel: it defines the log level for this instance of OpenWeatherMapGrabber.

Log levels can be, in order of increasing verbosity:

$CONKW_HOME/config/logging.properties

This file defines how the logger works. This is the default conkw config file for java.util.logging.

handlers= net.pieroxy.conkw.utils.logging.FileHandler

.level= INFO
http_log.handlers=net.pieroxy.conkw.utils.logging.HttpFileHandler
http_log.useParentHandlers=false
http_log.level = FINE

net.pieroxy.conkw.utils.logging.FileHandler.pattern = /home/myuser/.conkw/log/conkw.log
net.pieroxy.conkw.utils.logging.FileHandler.limit = 5000000
net.pieroxy.conkw.utils.logging.FileHandler.count = 10
net.pieroxy.conkw.utils.logging.FileHandler.level = FINEST
net.pieroxy.conkw.utils.logging.FileHandler.append = true
net.pieroxy.conkw.utils.logging.FileHandler.formatter = net.pieroxy.conkw.utils.logging.SingleLineFormatter

net.pieroxy.conkw.utils.logging.HttpFileHandler.pattern = /home/myuser/.conkw/log/http.log
net.pieroxy.conkw.utils.logging.HttpFileHandler.limit = 5000000
net.pieroxy.conkw.utils.logging.HttpFileHandler.count = 10
net.pieroxy.conkw.utils.logging.HttpFileHandler.level = FINEST
net.pieroxy.conkw.utils.logging.HttpFileHandler.append = true
net.pieroxy.conkw.utils.logging.HttpFileHandler.formatter = net.pieroxy.conkw.utils.logging.SingleLineFormatter

First, we use our own version of FileHandler. The feature in there is that it rotates and compress the old log files.

Then, the default level is INFO. This is where you can change it, although we recommend running with this in production.

The next three lines define a specific logger for http_log. We don't want the http log file mixed with the rest of the messages.

Then we configure the FileHandler.

Last, we configure the logger we've defined for http_log.

For example, here the log for a shutdown sequence:


2021-08-12 08:26:16 WARNING roxy.conkw.webapp.servlets.Api Shutdown sequence requested.
2021-08-12 08:26:17    INFO ieroxy.conkw.standalone.Runner Shutting Down.
2021-08-12 08:26:17    INFO oyote.http11.Http11NioProtocol Pausing ProtocolHandler ["http-nio-12789"]
2021-08-12 08:26:17    INFO .catalina.core.StandardService Stopping service [Tomcat]
2021-08-12 08:26:17    INFO                         JVM GC [GC (Allocation Failure)  69770K->63755K(84160K), 4ms]
2021-08-12 08:26:17    INFO roxy.conkw.webapp.servlets.Api Api Thread stopped.
2021-08-12 08:26:17    INFO webapp.servlets.ApiAuthManager Stopping save thread.
2021-08-12 08:26:17    INFO bers.JavaSystemViewGrabber/sys Dispose sys
2021-08-12 08:26:17    INFO rabbers.PushToEmiGrabber/p2emi Stopping PushToEmiGrabber
2021-08-12 08:26:17    INFO LatestUnreadMailsGrabber/mails Dispose mails
2021-08-12 08:26:17    INFO xternalMetricsGrabber/test_emi Stopping save thread.
2021-08-12 08:26:17    INFO                         stdout Hello world!!!
2021-08-12 08:26:17    INFO oyote.http11.Http11NioProtocol Stopping ProtocolHandler ["http-nio-12789"]
2021-08-12 08:26:17    INFO oyote.http11.Http11NioProtocol Destroying ProtocolHandler ["http-nio-12789"]

And here is what it means:

Cheat sheet