Skip to content

Commit 4e70056

Browse files
committed
DAOS-17989 common: Logs with unified severity
Server and engine logs to use the same severity spelling. DBUG → DEBUG, ERR → ERROR, EMRG → FATAL Signed-off-by: Tomasz Gromadzki <[email protected]>
1 parent e837088 commit 4e70056

File tree

102 files changed

+279
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+279
-281
lines changed

docs/admin/deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ engines:
13291329
nr_xs_helpers: 4 # count of I/O offload threads
13301330
fabric_iface: eth0 # network interface to use for this engine
13311331
fabric_iface_port: 31416 # network port
1332-
log_mask: ERR # debug level to start with the engine with
1332+
log_mask: ERROR # debug level to start with the engine with
13331333
log_file: /var/log/daos/daos_engine0.log # where to store engine logs
13341334
storage:
13351335
-

docs/admin/env_variables.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ Environment variables in this section only apply to the client side.
8686
|D\_LOG\_SIZE|DAOS debug logs (both server and client) have a 1GB file size limit by default. When this limit is reached, the current log file is closed and renamed with a .old suffix, and a new one is opened. This mechanism will repeat each time the limit is reached, meaning that available saved log records could be found in both ${D_LOG_FILE} and last generation of ${D_LOG_FILE}.old files, to a maximum of the most recent 2*D_LOG_SIZE records. This can be modified by setting this environment variable ("D_LOG_SIZE=536870912"). Sizes can also be specified in human-readable form using `k`, `m`, `g`, `K`, `M`, and `G`. The lower-case specifiers are base-10 multipliers and the upper case specifiers are base-2 multipliers.|
8787
|D\_LOG\_FLUSH|Allows to specify a non-default logging level where flushing will occur. By default, only levels above WARN will cause an immediate flush instead of buffering.|
8888
|D\_LOG\_TRUNCATE|By default log is appended. But if set this variable will cause log to be truncated upon first open and logging start.|
89-
|DD\_SUBSYS |Used to specify which subsystems to enable. DD\_SUBSYS can be set to individual subsystems for finer-grained debugging ("DD\_SUBSYS=vos"), multiple facilities ("DD\_SUBSYS=bio,mgmt,misc,mem"), or all facilities ("DD\_SUBSYS=all") which is also the default setting. If a facility is not enabled, then only ERR messages or more severe messages will print.|
90-
|DD\_STDERR |Used to specify the priority level to output to stderr. Options in decreasing priority level order: FATAL, CRIT, ERR, WARN, NOTE, INFO, DEBUG. By default, all CRIT and more severe DAOS messages will log to stderr ("DD\_STDERR=CRIT"), and the default for CaRT/GURT is FATAL.|
91-
|D\_LOG\_MASK|Used to specify what type/level of logging will be present for either all of the registered subsystems or a select few. Options in decreasing priority level order: FATAL, CRIT, ERR, WARN, NOTE, INFO, DEBUG. DEBUG option is used to enable all logging (debug messages as well as all higher priority level messages). Note that if D\_LOG\_MASK is not set, it will default to logging all messages excluding debug ("D\_LOG\_MASK=INFO"). Example: "D\_LOG\_MASK=DEBUG". This will set the logging level for all facilities to DEBUG, meaning that all debug messages, as well as higher priority messages will be logged (INFO, NOTE, WARN, ERR, CRIT, FATAL). Example 2: "D\_LOG\_MASK=DEBUG,MEM=ERR,RPC=ERR". This will set the logging level to DEBUG for all facilities except MEM & RPC (which will now only log ERR and higher priority level messages, skipping all DEBUG, INFO, NOTE & WARN messages)|
89+
|DD\_SUBSYS |Used to specify which subsystems to enable. DD\_SUBSYS can be set to individual subsystems for finer-grained debugging ("DD\_SUBSYS=vos"), multiple facilities ("DD\_SUBSYS=bio,mgmt,misc,mem"), or all facilities ("DD\_SUBSYS=all") which is also the default setting. If a facility is not enabled, then only ERROR messages or more severe messages will print.|
90+
|DD\_STDERR |Used to specify the priority level to output to stderr. Options in decreasing priority level order: FATAL, CRIT, ERROR, WARN, NOTE, INFO, DEBUG. By default, all CRIT and more severe DAOS messages will log to stderr ("DD\_STDERR=CRIT"), and the default for CaRT/GURT is FATAL.|
91+
|D\_LOG\_MASK|Used to specify what type/level of logging will be present for either all of the registered subsystems or a select few. Options in decreasing priority level order: FATAL, CRIT, ERROR, WARN, NOTE, INFO, DEBUG. DEBUG option is used to enable all logging (debug messages as well as all higher priority level messages). Note that if D\_LOG\_MASK is not set, it will default to logging all messages excluding debug ("D\_LOG\_MASK=INFO"). Example: "D\_LOG\_MASK=DEBUG". This will set the logging level for all facilities to DEBUG, meaning that all debug messages, as well as higher priority messages will be logged (INFO, NOTE, WARN, ERROR, CRIT, FATAL). Example 2: "D\_LOG\_MASK=DEBUG,MEM=ERROR,RPC=ERROR". This will set the logging level to DEBUG for all facilities except MEM & RPC (which will now only log ERROR and higher priority level messages, skipping all DEBUG, INFO, NOTE & WARN messages)|
9292
|DD\_MASK |Used to enable different debug streams for finer-grained debug messages, essentially allowing the user to specify an area of interest to debug (possibly involving many different subsystems) as opposed to parsing through many lines of generic DEBUG messages. All debug streams will be enabled by default ("DD\_MASK=all"). Single debug masks can be set ("DD\_MASK=trace") or multiple masks ("DD\_MASK=trace,test,mgmt"). Note that since these debug streams are strictly related to the debug log messages, D\_LOG\_MASK must be set to DEBUG. Priority messages higher than DEBUG will still be logged for all facilities unless otherwise specified by D\_LOG\_MASK (not affected by enabling debug masks).|
9393
|CRT\_CTX\_NUM|For regular non-scalable endpoint mode this variable can be used to override maximum number of contexts that can be created, up to 64. By default the maximum number is set to the number of cores available on the system. For scalable endpoint mode specifies total number of contexts to be allocated by the process.|

docs/admin/troubleshooting.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ with D_LOG_MASK, which by default is set to INFO
142142
("D_LOG_MASK=INFO"), which will result in all messages excluding DEBUG
143143
messages being logged. D_LOG_MASK can also be used to specify the
144144
level of logging on a per-subsystem basis as well
145-
("D_LOG_MASK=DEBUG,MEM=ERR").
145+
("D_LOG_MASK=DEBUG,MEM=ERROR").
146146

147147
- Log Levels:
148-
debug, dbug, info, note, warn, error, err, crit, alrt, fatal, emrg, emit
148+
debug, info, note, warn, error, err, crit, alrt, fatal, emit
149149

150-
Note: debug == dbug, error == err and fatal == emrg.
150+
Note: error == err.
151151

152152
### Debug Masks/Streams:
153153

@@ -214,7 +214,7 @@ values per engine for the `DD_SUBSYS` and `DD_MASK` variable assignments).
214214

215215
- Disable all logs for performance tuning
216216

217-
D_LOG_MASK=ERR -> will only log error messages from all facilities
217+
D_LOG_MASK=ERROR -> will only log error messages from all facilities
218218
D_LOG_MASK=FATAL -> will only log system fatal messages
219219

220220
- Gather daos metadata logs if a pool/container resource problem is observed, using the provided group mask
@@ -224,9 +224,9 @@ values per engine for the `DD_SUBSYS` and `DD_MASK` variable assignments).
224224

225225
- Disable a noisy debug logging subsystem
226226

227-
D_LOG_MASK=DEBUG,MEM=ERR -> disables MEM facility by
227+
D_LOG_MASK=DEBUG,MEM=ERROR -> disables MEM facility by
228228
restricting all logs from that facility to ERROR or higher priority only
229-
D_LOG_MASK=DEBUG,SWIM=ERR,RPC=ERR,HG=ERR -> disables SWIM and RPC/HG facilities
229+
D_LOG_MASK=DEBUG,SWIM=ERROR,RPC=ERROR,HG=ERROR -> disables SWIM and RPC/HG facilities
230230

231231
- Enable a subset of facilities of interest
232232

@@ -358,8 +358,8 @@ ERROR: dmg: Unable to load Certificate Data: could not load cert: stat /etc/daos
358358
### use daos command before daos_agent started
359359
```
360360
$ daos cont create $DAOS_POOL
361-
daos ERR src/common/drpc.c:217 unixcomm_connect() Failed to connect to /var/run/daos_agent/daos_agent.sock, errno=2(No such file or directory)
362-
mgmt ERR src/mgmt/cli_mgmt.c:222 get_attach_info() failed to connect to /var/run/daos_agent/daos_agent.sock DER_MISC(-1025): 'Miscellaneous error'
361+
daos ERROR src/common/drpc.c:217 unixcomm_connect() Failed to connect to /var/run/daos_agent/daos_agent.sock, errno=2(No such file or directory)
362+
mgmt ERROR src/mgmt/cli_mgmt.c:222 get_attach_info() failed to connect to /var/run/daos_agent/daos_agent.sock DER_MISC(-1025): 'Miscellaneous error'
363363
failed to initialize daos: Miscellaneous error (-1025)
364364
365365
@@ -453,7 +453,7 @@ ERROR: dmg: pool create failed: DER_NOSPACE(-1007): No space on storage target
453453
```
454454
### daos_engine fails to start with error "Address already in use"
455455
```
456-
09/26-15:25:38.06 node-1 DAOS[3851384/-1/0] external ERR # [4462751.071824] mercury->cls: [error] /builddir/build/BUILD/mercury-2.2.0/src/na/na_ofi.c:3638
456+
09/26-15:25:38.06 node-1 DAOS[3851384/-1/0] external ERROR # [4462751.071824] mercury->cls: [error] /builddir/build/BUILD/mercury-2.2.0/src/na/na_ofi.c:3638
457457
na_ofi_basic_ep_open(): fi_enable() failed, rc: -98 (Address already in use)
458458
459459
"Address already in use" will be observed when there is more than one engine per node sharing the same NIC and fabric_iface_port of engines are too close; e.g., the difference is not larger than 3.

docs/debugging.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ All macros which output logs have a priority level, shown in descending order
2727
below.
2828
- D_FATAL(fmt, ...) FATAL
2929
- D_CRIT(fmt, ...) CRIT
30-
- D_ERROR(fmt, ...) ERR
30+
- D_ERROR(fmt, ...) ERROR
3131
- D_WARN(fmt, ...) WARN
3232
- D_NOTE(fmt, ...) NOTE
3333
- D_INFO(fmt, ...) INFO
@@ -40,7 +40,7 @@ however is separate from the priority of logging to `/tmp/daos.log`. The
4040
priority level of logging can be set with `D_LOG_MASK`, which by default is set
4141
to INFO (`D_LOG_MASK=INFO`), which will result in all messages excluding DEBUG
4242
messages being logged. `D_LOG_MASK` can also be used to specify the level of
43-
logging on a per-subsystem basis as well (`D_LOG_MASK="DEBUG,MEM=ERR"`).
43+
logging on a per-subsystem basis as well (`D_LOG_MASK="DEBUG,MEM=ERROR"`).
4444

4545
## Debug Masks/Streams:
4646

@@ -84,20 +84,20 @@ values per engine for the `DD_SUBSYS` and `DD_MASK` variable assignments).
8484

8585
- Disable all logs for performance tuning
8686
```bash
87-
$ export D_LOG_MASK=ERR # -> will only log error messages from all facilities
87+
$ export D_LOG_MASK=ERROR # -> will only log error messages from all facilities
8888
$ export D_LOG_MASK=FATAL # -> will only log system fatal messages
8989
```
9090

9191
- Disable a noisy debug logging subsystem
9292
```bash
93-
$ export D_LOG_MASK=DEBUG,MEM=ERR # -> disables MEM facility by restricting all logs
93+
$ export D_LOG_MASK=DEBUG,MEM=ERROR # -> disables MEM facility by restricting all logs
9494
# from that facility to ERROR or higher priority only
95-
$ export D_LOG_MASK=DEBUG,SWIM=ERR,RPC=ERR,HG=ERR # -> disables SWIM and RPC/HG facilities
95+
$ export D_LOG_MASK=DEBUG,SWIM=ERROR,RPC=ERROR,HG=ERROR # -> disables SWIM and RPC/HG facilities
9696
```
9797

9898
- Gather daos metadata logs if a pool/container resource problem is observed, using the provided group mask
9999
```bash
100-
$ export D_LOG_MASK=DEBUG,MEM=ERR # log at DEBUG level from all facilities except MEM
100+
$ export D_LOG_MASK=DEBUG,MEM=ERROR # log at DEBUG level from all facilities except MEM
101101
$ export DD_MASK=group_metadata # limit logging to include only streams (mgmt, plus defaults from group_default)
102102
```
103103

docs/user/container.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ follows:
390390

391391
```bash
392392
$ dfuse --pool tank --container mycont1 -m /tmp/dfuse
393-
dfuse ERR src/client/dfuse/dfuse_core.c:873 dfuse_cont_open(0x19b9b00) daos_cont_open() failed: DER_RF(-2031): 'Failures exceed RF'
393+
dfuse ERROR src/client/dfuse/dfuse_core.c:873 dfuse_cont_open(0x19b9b00) daos_cont_open() failed: DER_RF(-2031): 'Failures exceed RF'
394394
Failed to connect to container (5) Input/output error
395395
```
396396

@@ -412,8 +412,8 @@ create, try creating with valid `rd_fac`.
412412

413413
```bash
414414
$ daos container create tank mycont1 --type=POSIX
415-
object ERR src/object/obj_class.c:829 dc_set_oclass() grp_size 5 > domain_nr 1, DER_INVAL(-1003): 'Invalid parameters'
416-
dfs ERR src/client/dfs/cont.c:254 dfs_cont_create() Failed to generate SB OID DER_INVAL(-1003): 'Invalid parameters'
415+
object ERROR src/object/obj_class.c:829 dc_set_oclass() grp_size 5 > domain_nr 1, DER_INVAL(-1003): 'Invalid parameters'
416+
dfs ERROR src/client/dfs/cont.c:254 dfs_cont_create() Failed to generate SB OID DER_INVAL(-1003): 'Invalid parameters'
417417
ERROR: daos: failed to create container: DER_INVAL(-1003): Invalid parameters
418418
```
419419

docs/user/interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ except DaosApiError as e:
161161
#### Logging
162162

163163
The Python DAOS API exposes functionality to log messages to the DAOS client log.
164-
Messages can be logged as `INFO`, `DEBUG`, `WARN`, or `ERR` log levels.
164+
Messages can be logged as `INFO`, `DEBUG`, `WARN`, or `ERROR` log levels.
165165
The DAOS log object must be initialized with the environmental context in which to run:
166166

167167
```python

src/cart/README.env

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ This file lists the environment variables used in CaRT.
5252
BULK, GRP, LM, HG, etc.
5353
Can set different log level for different subsystems, for example:
5454
"export D_LOG_MASK=DEBUG" will set all subsystems' loglevel as DEBUG
55-
"export D_LOG_MASK=ERR,RPC=DEBUG,BULK=INFO" will set RPC's loglevel as
56-
DEBUG, BULK's log level as INFO, all other subsystems' loglevel as ERR.
55+
"export D_LOG_MASK=ERROR,RPC=DEBUG,BULK=INFO" will set RPC's loglevel as
56+
DEBUG, BULK's log level as INFO, all other subsystems' loglevel as ERROR.
5757
If neither above 2 or 3 ENVs set, the default loglevel is WARN and log device
5858
is stdout.
5959

@@ -69,7 +69,7 @@ This file lists the environment variables used in CaRT.
6969

7070
. D_LOG_FLUSH
7171
Specifies priority level for flushing of messages into the log file.
72-
Can be set to one of the following "DBUG,INFO,NOTE,WARN,ERR,CRIT,ALRT,EMRG,EMIT"
72+
Can be set to one of the following "DEBUG,INFO,NOTE,WARN,ERROR,CRIT,ALRT,FATAL,EMIT"
7373
If not set will default to "WARN".
7474

7575
. DD_STDERR

src/common/debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ daos_debug_init_ex(char *logfile, d_dbug_t logmask)
242242

243243
int daos_debug_init(char *logfile)
244244
{
245-
/* for client side, by default use ERR level */
245+
/* for client side, by default use ERROR level */
246246
return daos_debug_init_ex(logfile, DLOG_ERR);
247247
}
248248

src/control/cmd/daos/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ or query/manage an object inside a container.`
118118
if opts.Debug {
119119
log.SetLevel(logging.LogLevelTrace)
120120
if os.Getenv("D_LOG_MASK") == "" {
121-
os.Setenv("D_LOG_MASK", "DEBUG,OBJECT=ERR,PLACEMENT=ERR")
121+
os.Setenv("D_LOG_MASK", "DEBUG,OBJECT=ERROR,PLACEMENT=ERROR")
122122
}
123123
if os.Getenv("DD_MASK") == "" {
124124
os.Setenv("DD_MASK", "mgmt")

src/control/cmd/dmg/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type serverSetLogMasksCmd struct {
2828
ctlInvokerCmd
2929
hostListCmd
3030
cmdutil.JSONOutputCmd
31-
Masks *string `short:"m" long:"masks" description:"Set log masks for a set of facilities to a given level. The input string should look like PREFIX1=LEVEL1,PREFIX2=LEVEL2,... where the syntax is identical to what is expected by 'D_LOG_MASK' environment variable. If the 'PREFIX=' part is omitted, then the level applies to all defined facilities (e.g. a value of 'WARN' sets everything to WARN). If unset then reset engine log masks to use the 'log_mask' value set in the server config file (for each engine) at the time of DAOS system format. Supported levels are FATAL, CRIT, ERR, WARN, NOTE, INFO, DEBUG"`
31+
Masks *string `short:"m" long:"masks" description:"Set log masks for a set of facilities to a given level. The input string should look like PREFIX1=LEVEL1,PREFIX2=LEVEL2,... where the syntax is identical to what is expected by 'D_LOG_MASK' environment variable. If the 'PREFIX=' part is omitted, then the level applies to all defined facilities (e.g. a value of 'WARN' sets everything to WARN). If unset then reset engine log masks to use the 'log_mask' value set in the server config file (for each engine) at the time of DAOS system format. Supported levels are FATAL, CRIT, ERROR, WARN, NOTE, INFO, DEBUG"`
3232
Streams *string `short:"d" long:"streams" description:"Employ finer grained control over debug streams. Mask bits are set as the first argument passed in D_DEBUG(mask, ...) and this input string (DD_MASK) can be set to enable different debug streams. The expected syntax is a comma separated list of stream identifiers and accepted DAOS Debug Streams are md,pl,mgmt,epc,df,rebuild,daos_default and Common Debug Streams (GURT) are any,trace,mem,net,io. If not set, streams will be read from server config file and if set to an empty string then all debug streams will be enabled"`
3333
Subsystems *string `short:"s" long:"subsystems" description:"This input string is equivalent to the use of the DD_SUBSYS environment variable and can be set to enable logging for specific subsystems or facilities. The expected syntax is a comma separated list of facility identifiers. Accepted DAOS facilities are common,tree,vos,client,server,rdb,pool,container,object,placement,rebuild,tier,mgmt,bio,tests, Common facilities (GURT) are MISC,MEM and CaRT facilities RPC,BULK,CORPC,GRP,LM,HG,ST,IV If not set, subsystems to enable will be read from server config file and if set to an empty string then logging all subsystems will be enabled"`
3434
}

0 commit comments

Comments
 (0)