[SERVER-14782] 15 or more "v" in verbosity setting fails to set any verbosity level Created: 04/Aug/14  Updated: 31/Jul/15  Resolved: 13/Aug/14

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: 2.6.3, 2.7.4
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Andrew Emil (Inactive) Assignee: Benety Goh
Resolution: Won't Fix Votes: 0
Labels: 28qa, community-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Sprint: Server 2.7.5
Participants:

 Description   

If you start a mongod instance with 15 or more "v"s of verbosity, no verbosity setting will be used.

Example:
With 14 "v"s:

{
        "argv" : [
                "./mongod",
                "--dbpath",
                "../scratch/logtestingdata/",
                "--logpath",
                "../scratch/logtestingdata/log",
                "--fork",
                "--port",
                "27018",
                "-vvvvvvvvvvvvvvv"
        ],
        "parsed" : {
                "net" : {
                        "port" : 27018
                },
                "processManagement" : {
                        "fork" : true
                },
                "storage" : {
                        "dbPath" : "../scratch/logtestingdata/"
                },
                "systemLog" : {
                        "destination" : "file",
                        "path" : "../scratch/logtestingdata/log",
                        "verbosity" : 14
                }
        },
        "ok" : 1
}

With 15 "v"s:

{
        "argv" : [
                "./mongod",
                "--dbpath",
                "../scratch/logtestingdata/",
                "--logpath",
                "../scratch/logtestingdata/log",
                "--fork",
                "--port",
                "27018",
                "-vvvvvvvvvvvvvvvv"
        ],
        "parsed" : {
                "net" : {
                        "port" : 27018
                },
                "processManagement" : {
                        "fork" : true
                },
                "storage" : {
                        "dbPath" : "../scratch/logtestingdata/"
                },
                "systemLog" : {
                        "destination" : "file",
                        "path" : "../scratch/logtestingdata/log"
                },
                "verbose" : "vvvvvvvvvvvvvvv"
        },
        "ok" : 1
}

Buildinfo for debugging purposes:

> db.runCommand({buildinfo:1})
{
        "version" : "2.7.5-pre-",
        "gitVersion" : "6e2f3346f21f8e5de68aa5099317512ef51eb023",
        "OpenSSLVersion" : "",
        "sysInfo" : "Linux localhost.localdomain 3.13.10-200.fc20.x86_64 #1 SMP Mon Apr 14 20:34:16 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49",
        "loaderFlags" : "-fPIC -pthread -Wl,-z,now -rdynamic",
        "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -std=c++11 -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -fno-builtin-memcmp -std=c99",
        "allocator" : "tcmalloc",
        "versionArray" : [
                2,
                7,
                5,
                -100
        ],
        "javascriptEngine" : "V8",
        "bits" : 64,
        "debug" : false,
        "maxBsonObjectSize" : 16777216,
        "ok" : 1
}

Also tested and successfully reproduced against 2.6.3



 Comments   
Comment by Benety Goh [ 04/Aug/14 ]

src/mongo/db/server_options_helpers.cpp

        // Handle both the "--verbose" string argument and the "-vvvv" arguments at the same time so
        // that we ensure that we set the log level to the maximum of the options provided
        int logLevel = -1;
        for (std::string s = ""; s.length() <= 14; s.append("v")) {
            if (!s.empty() && params->count(s) && (*params)[s].as<bool>() == true) {
                logLevel = s.length();
            }

Generated at Thu Feb 08 03:35:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.