---
name: "scsi_logging_level"
section: "8"
platform: "linux"
package: "sg3_utils"
version: "1.49-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/scsi_logging_level"
---

# scsi\_logging\_level(8)

access Linux SCSI logging level information

## NAME

scsi\_logging\_level - access Linux SCSI logging level information

## SYNOPSIS

**scsi\_logging\_level** \[*--all=LEV*\] \[*--create*\] \[*--error=LEV*\] \[*--get*\] \[*--help*\] \[*--highlevel=LEV*\] \[*--hlcomplete=LEV*\] \[*--hlqueue=LEV*\] \[*--ioctl=LEV*\] \[*--llcomplete=LEV*\] \[*--llqueue=LEV*\] \[*--lowlevel=LEV*\] \[*--midlevel=LEV*\] \[*--mlcomplete=LEV*\] \[*--mlqueue=LEV*\] \[*--scan=LEV*\] \[*--set*\] \[*--timeout=LEV*\] \[*--version*\]

## DESCRIPTION

This bash shell script accesses the Linux SCSI subsystem logging level. The current values can be shown (e.g. with *--get*) or changed (e.g. with *--set*). Superuser permissions will typically be required to set the logging level.

One of these options: *--create*, *--get* or *--set* is required. Only one of them can be given.

## OPTIONS

Arguments to long options are mandatory for short options as well.

- **-a**, **--all**=*LEV*

  *LEV* is used for all SCSI\_LOG fields.

- **-c**, **--create**

  Options are parsed and placed in internal fields that are displayed but no logging levels are changed within the Linux kernel.

- **-E**, **--error**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_ERROR field.

- **-g**, **--get**

  Fetches the current SCSI logging levels from the Linux kernel and displays them.

- **-h**, **--help**

  print out the usage message then exit.

- **-H**, **--highlevel**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_HLQUEUE and SCSI\_LOG\_HLCOMPLETE fields.

- **--hlcomplete**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_HLCOMPLETE field.

- **--hlqueue**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_HLQUEUE field.

- **-I**, **--ioctl**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_IOCTL field.

- **--llcomplete**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_LLCOMPLETE field.

- **--llqueue**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_LLQUEUE field.

- **-L**, **--lowlevel**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_LLQUEUE and SCSI\_LOG\_LLCOMPLETE fields.

- **-M**, **--midlevel**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_MLQUEUE and SCSI\_LOG\_MLCOMPLETE fields.

- **--mlcomplete**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_MLCOMPLETE field.

- **--mlqueue**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_MLQUEUE field.

- **-S**, **--scan**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_SCAN field.

- **-s**, **--set**

  Uses the fields specified in this command's options and attempts to apply them to the Linux SCSI subsystem logging levels. Typically superuser permissions will be required to do this.

- **-T**, **--timeout**=*LEV*

  *LEV* is placed in the SCSI\_LOG\_TIMEOUT field.

- **-v**, **--version**

  Outputs the version information and then exits.

## NOTES

The *--get* and *--set* options access the /proc/sys/dev/scsi/logging\_level pseudo file.

## EXIT STATUS

The exit status of this script is 0 when it is successful. Any other exit status indicates that an error has occurred.

## EXAMPLES

The following will set SCSI\_LOG\_ERROR to level 5 in the Linux kernel. It requires root permissions:

  scsi\_logging\_level -s -E 5

So as to not interfere with other SCSI subsystem upper level drivers (ULDs) which most likely will be active at the same time, the Linux sg driver uses SCSI\_LOG\_TIMEOUT for logging purposes. To see full debugging and trace from the sg driver use:

  scsi\_logging\_level -s -T 7

The output from the sg driver caused by this will go to the system logs (e.g. /var/log/syslog). To reduce the amount of output use a number lower than 7. Using 0 will turn off the tracing and debug.

To turn on maximum SCSI subsystem logging use:

  scsi\_logging\_level -s -a 7

That is probably best done on a system that does not use a SCSI command device to hold the root file system, or the file system that holds the system log. Note that SATA disks and USB attached storage nearly always use the SCSI subsystem.

## AUTHORS

Written by IBM. Small alterations by Douglas Gilbert.

## REPORTING BUGS

Report bugs to \<dgilbert at interlog dot com\>.

## COPYRIGHT

Copyright © IBM Corp. 2006\
 This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The software was obtained from an IBM package called s390-tools-1.6.2 found on that company's "developerworks" site. The most recent version of that package at this time is 1.8.3 .
