Issue:
How do I adjust logging levels in Fusion 5.x?
Environment:
Fusion 5.x
Resolution:
In Fusion 5.x, Fusion Services come pre-configured to write messages to stdout and send messages to Logstash as outlined here.
In a containerized environment like Kubernetes, the recommended approach is to change the values.yaml file used when deploying a Fusion 5.x service. This will set a parameter which sets the logging level for a particular logger.
To update logging to debug for api-gateway, add “logLevelRoot: debug“ to “<cluster>_<namespace>_fusion_values.yaml“ as shown in below code. Make sure it at the same level as “javaToolOptions“.
api-gateway:
service:
type: "NodePort"
ingress:
enabled: true
host: "<server>"
path: "/*"
tls:
enabled: true
javaToolOptions: "-Xmx2g"
logLevelRoot: debug
pod:
annotations:
prometheus.io/port: "6764"
prometheus.io/scrape: "true"
prometheus.io/path: "/actuator/prometheus"
Adjusting individual loggers
By default, loggers are named after the Java package+class name i.e. com.lucidworks.fusion.ml. To adjust the level one or more loggers without changing the overall default, add a parameter to the Java system properties within values.yaml.
ml-model-service:
enabled: false
image:
imagePullPolicy: "IfNotPresent"
nodeSelector:
fusion_node_type: system
modelRepoImpl: fusion
fs:
enabled: true
javaToolOptions: "-Dlogging.level.com.lucidworks.fusion.ml=INFO"
If files are edited and log levels are changed, is a restart of the component required?
- it would have to be done on each pod so if you have three API pods, you’d have to edit each
- it requires a restart of the SERVICE process in the pod but not a restart/recreate of the pod.
- If the pod is recreated, the edits to the config file are wiped out.
Should we enable debugging in Production?
Generally we don’t recommend enabling debugging in production as it can impact performance. This should be ad-hoc on an as-needed basis.
Comments
0 comments
Please sign in to leave a comment.