Bug 1757976

Summary: [RFE] Improve stratisd log levels
Product: Red Hat Enterprise Linux 8 Reporter: Dennis Keefe <dkeefe>
Component: stratisdAssignee: mulhern <amulhern>
Status: CLOSED ERRATA QA Contact: guazhang <guazhang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.4CC: amulhern, dkeefe, dlehman, rhandlin
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: 2.2.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:58:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dennis Keefe 2019-10-02 20:29:18 UTC
Add log levels to stratisd from the command-line currently there is only debug
Additional levels might be info, error, warn, trace.


How reproducible:

1. check stratisd man page
2. test stratisd via cli
   # stratisd --info
3. verify logs in journalctl report the default or specified log level for 
   stratisd events.

Comment 3 mulhern 2020-08-19 23:43:13 UTC
See upstream PR: https://github.com/stratis-storage/stratisd/pull/2095.

Comment 4 mulhern 2020-08-19 23:48:18 UTC
Our help text looks like this:

[mulhern@localhost ~/stratis2/stratisd (develop-2.1.0-liminal)]$ ./target/debug/stratisd --help
stratis 2.2.0
Stratis storage management

USAGE:
    stratisd [FLAGS] [OPTIONS]

FLAGS:
    -h, --help       Prints help information
        --sim        Use simulator engine
    -V, --version    Prints version information

OPTIONS:
        --log-level <log-level>    Sets level for generation of log messages. [values: trace, debug, info, warn, error]

which explains what the --log-level flag does.

And the man page:

       --log-level
           Specify the log level for log messages. Only messages with severity
           at or above the level specified will be emitted. If this option is
           omitted, stratisd respects the RUST_LOG environment variable.
           Otherwise, stratisd uses the default log level, which is error.

Comment 6 guazhang@redhat.com 2020-12-24 05:52:14 UTC
Hi


 #man stratisd 

       --log-level
           Specify the log level for log messages. Only messages with severity at or above the level specified will be
           emitted. If this option is omitted, stratisd respects the RUST_LOG environment variable. Otherwise, stratisd
           uses the default log level, which is error.



[root@intel-purley-qat-01 ~]# /usr/libexec/stratisd --help
stratis 2.3.0
Stratis storage management

USAGE:
    stratisd [FLAGS] [OPTIONS]

FLAGS:
    -h, --help       Prints help information
        --sim        Use simulator engine
    -V, --version    Prints version information

OPTIONS:
        --log-level <log-level>    Sets level for generation of log messages. [possible values: trace, debug, info,
                                   warn, error]



test pass with stratis 2.3.0

Comment 11 errata-xmlrpc 2021-05-18 15:58:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (stratis-cli bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1901