Logging

SCSI2Pi offers numerous logging capabilities. For s2p, s2pdump and s2pexec the log level is configured with the --log-level or -L command line option:

>s2p --log-level debug

With s2p you can also control the logging with a property. During runtime you can change the s2p log level with the SCSI Control app or s2pctl:

>s2pctl -L trace

The available log levels are trace, debug, info, warning, error, critical and off. The default level is info.

Logging with s2p

s2p provides a detailed logging especially on trace level. The log output can be restricted to a particular device:

>s2p -i 0 test.hds -i 0:31 printer -L trace:1:31

In this exampe the log level is set to trace only for the device with SCSI ID 1 and LUN 31.

Logging of SCSI commands

On level trace s2p logs detailed information on SCSI commands and their parameters. These data are helpful when analyzing problems, especially when there are incompatibilities with drivers or devices.

[2024-01-21 09:54:12.237] [debug] (ID 3) - Controller is executing ModeSelect6, CDB $15:00:00:00:32:00
[2024-01-21 09:54:12.238] [debug] (ID:LUN 3:31) - Device is executing ModeSelect6 ($15)
[2024-01-21 09:54:12.239] [trace] (ID 3) - Data Out phase
[2024-01-21 09:54:12.239] [trace] (ID 3) - 50 byte(s) of command parameter data:
00000000 65:78:70:6f:72:74:20:50:53:31:3d:27:5c:68:3e:27  'export PS1='\h>''
00000010 0a:0a:69:66:20:5b:5b:20:24:54:45:52:4d:20:3d:3d  '..if [[ $TERM =='
00000020 20:78:74:65:72:6d:2a:20:5d:5d:0a:74:68:65:6e:0a  ' xterm* ]].then.'
00000030 20:20                                            '  '
[2024-01-21 09:54:12.244] [debug] (ID 3) - CHECK CONDITION: ILLEGAL REQUEST (Sense Key $05), INVALID FIELD IN CDB (ASC $24)
[2024-01-21 09:54:12.245] [trace] (ID 3) - Status phase, status is $02
[2024-01-21 09:54:12.245] [trace] (ID 3) - Bus Free phase

SCSI error codes are logged in a human-readable format.

Logging of DaynaPort network packets

On level trace also network packets received and sent by the DaynaPort emulation are recorded.

[2024-01-22 13:29:02.139] [trace] (ID:LUN 6:0) - Received 90 byte(s) of network data:
00000000 08:00:00:05:f4:80:33:33:00:00:00:01:f8:32:e4:71  '......33.....2.q'
00000010 14:c7:86:dd:60:04:d3:56:00:20:3a:ff:fe:80:00:00  '....`..V. :.....'
00000020 00:00:00:00:42:78:78:be:b7:08:33:be:ff:02:00:00  '....Bxx...3.....'
00000030 00:00:00:00:00:00:00:00:00:00:00:01:88:00:f9:d5  '................'
00000040 20:00:00:00:2a:02:80:71:22:84:53:40:6d:b7:c5:4e  ' ...*..q".S@m..N'
00000050 2f:37:44:6a:02:01:f8:32:e4:71                    '/7Dj...2.q'