Meilisearch logging to stdout #2514
-
Hey meilisearch team and community, I am running meilisearch (currently version 0.25) in a container in kubernetes on GCP. I have been using and adopting the example manifests. They were very useful and it going quite well. One thing I noticed is that the logs (namely the health endpoint logs) end up reported as errors in GCP. The reason seems to be, that the logs are written to Here is the log from GCP: {
"textPayload": "[2022-06-14T10:05:19Z INFO actix_web::middleware::logger] 10.84.2.1:45498 \"GET /health HTTP/1.1\" 200 22 \"-\" \"kube-probe/1.21\" 0.000064",
"insertId": "cmi8d62rknq94vyz",
"resource": {
"type": "k8s_container",
"labels": {
"cluster_name": "cluster-1",
"pod_name": "meilisearch-0",
"namespace_name": "default",
"container_name": "meilisearch",
"location": "XXXXXXXXX",
"project_id": "XXXXXXXXXXXX"
}
},
"timestamp": "2022-06-14T10:05:19.285621218Z",
"severity": "ERROR",
"labels": {
"k8s-pod/controller-revision-hash": "meilisearch-6994d65955",
"k8s-pod/app_kubernetes_io/instance": "meilisearch",
"k8s-pod/app_kubernetes_io/name": "meilisearch",
"compute.googleapis.com/resource_name": "gke-XXXXXXXXXXXX",
"k8s-pod/statefulset_kubernetes_io/pod-name": "meilisearch-0"
},
"logName": "projects/XXXXXXXXXXXX/logs/stderr",
"receiveTimestamp": "2022-06-14T10:05:20.065729855Z"
} I think it would help me to confirm what is going and find a solution if I got some answers to the following questions: Is meili indeed logging to Did this change in recent versions or is this planned to be changing? Any ideas how I could change that? I was thinking about redirecting to stdout mabye by changing the Any help would be much apprechiated! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Hello @hendrikniemann |
Beta Was this translation helpful? Give feedback.
-
Okay, it seems like Meili is logging to |
Beta Was this translation helpful? Give feedback.
-
Hello @oluademola, it would be cool if you could give this thing another look! I have been doing another round of digging and I found out that the rust crate documentation for Redirecting the I am not sure if this is the desirable behaviour. For my setup at least, it creates quite some inconvinience as debug messages are picked up as errors within Google Cloud Logging. I understand that changing this would be a breaking change as others might rely on this in their deployments. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the additional information. You are right, and sorry for the confusion. We discussed this internally and indeed meilisearch logs to I hope this helps. Many thanks 🙂 |
Beta Was this translation helpful? Give feedback.
-
At the risk of being Opinionated, I agree with OP in that I was surprised to see the logs going to stderr. While there is no published standard, logs-to-stdout, errors-to-stderr is the default for most of the products I have run in production (see: Apache, nginx), as evidenced by the fact that our log ingestor is treating the Meilisearch access log as errors, which is very noisy. |
Beta Was this translation helpful? Give feedback.
Hi @hendrikniemann
Thank you for the additional information.
You are right, and sorry for the confusion. We discussed this internally and indeed meilisearch logs to
stderr
, which is typical and common for software. I am aware of the impact this would have on you, but as I already explained, there are no current plans to change the default logger. However, as you can see on our roadmap page, we are looking into the idea of allowing users to specify a log path in the future.I hope this helps. Many thanks 🙂