Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Created by Guest
Created on Dec 23, 2020

Use word, not letter to define log levels in Ops Manager

The following log messages are "info" level messages which can be found in the kubernetes logs from the ops-manager-db pods: ```sh {"logType":"mongodb","contents":"2020-12-16T02:42:28.557+0000 I WRITE [conn7329] update monitoringstatus.config.agentSessions command: { q: { _id: \"mongodb-rs-1.mongodb-rs-svc.mongodb.svc.cluster.local-48cc126fc451d9fa2ffa7569363971f2-5fbedc8dc354771c77dd1932\", s: \"KHNA9JiqXcos5V0d\" }, u: { $set: { s: \"PRIMARY\", p: true } }, multi: false, upsert: false } planSummary: IXSCAN { _id: 1 } numYields:0 queryHash:6C451E2F planCacheKey:38AD5486 ok:0 errMsg:\"E11000 duplicate key error collection: monitoringstatus.config.agentSessions index: cid_1_s_1 dup key: { cid: ObjectId('5fbedc8dc354771c77dd1932'), s: \\\"PRIMARY\\\" }\" errName:DuplicateKey errCode:11000 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 1 } }, ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } }, Mutex: { acquireCount: { r: 1 } } } flowControl:{ acquireCount: 1 } storage:{} 200ms"} {"logType":"mongodb","contents":"2020-12-16T02:42:53.558+0000 I WRITE [conn129189] update backupagentstatus.backupAgentSessions command: { q: { groupId: ObjectId('5fbedc8dc354771c77dd1932'), tag: \"unassigned\", $or: [ { sessionKey: \"5fd130ec9621b221acd18451\" }, { heartbeat: { $lt: 1608086273347 } } ] }, u: { $set: { groupId: ObjectId('5fbedc8dc354771c77dd1932'), tag: \"unassigned\", sessionKey: \"5fd130ec9621b221acd18451\", heartbeat: 1608086573347, hostname: \"mongodb-rs-0.mongodb-rs-svc.mongodb.svc.cluster.local\", addr: \"10.200.30.0\" }, $inc: { callsSinceSuccess: 1 } }, multi: false, upsert: true } planSummary: IXSCAN { groupId: 1, tag: 1 } keysInserted:1 numYields:0 queryHash:5BA6C0B5 planCacheKey:AEFF88E2 ok:0 errMsg:\"E11000 duplicate key error collection: backupagentstatus.backupAgentSessions index: groupId_1_tag_1 dup key: { groupId: ObjectId('5fbedc8dc354771c77dd1932'), tag: \\\"unassigned\\\" }\" errName:DuplicateKey errCode:11000 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 1 } }, ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } }, Mutex: { acquireCount: { r: 1 } } } flowControl:{ acquireCount: 1 } storage:{} 209ms"} ``` Despite the fact that the word "error" is in these logs many times, and they have an error code, error name, and error message, this is considered an info level log. This is because the letter `I` is after the date. This makes using regex really hard when trying to setup alerts and monitoring, if I wanted to exclude info level logs. It would be great of instead of using a letter like `I`, `W`, or `E`, a word or abbreviation was used such as `INFO`, `WARN` or `ERROR`.
  • Attach files