3 ms·
>There are still many situations where it’s not feasible to stop a process, attach the debugger For example when the person trying to fix it is not a programme
by trasz 5y ago
>There are still many situations where it’s not feasible to stop a process, attach the debugger
For example when the person trying to fix it is not a programmer. Human-readable logs are immensely useful for system administrators. Note the "human-readable" - don't dump some random binary garbage or flag values; log something that's actually useful for getting a high-level overview of what's happening.
For example, if you look at FreeBSD's "iscsid -d" output, you'll see this:
scsid: waiting for request from the kernel
iscsid: not forking due to -d flag; will exit after servicing a single request
iscsid: 127.0.0.1: global login_timeout at 60 sec
iscsid: 127.0.0.1: connecting to 127.0.0.1
iscsid: 127.0.0.1: Capsicum capability mode enabled
iscsid: 127.0.0.1: fetching limits from the kernel
iscsid: 127.0.0.1: setting session timeout to 60 seconds
iscsid: 127.0.0.1: beginning Login phase; sending Login PDU
iscsid: 127.0.0.1: key to send: "AuthMethod=None"
iscsid: 127.0.0.1: key to send: "InitiatorName=iqn.1994-09.org.freebsd:v3"
iscsid: 127.0.0.1: key to send: "SessionType=Discovery"
iscsid: 127.0.0.1: key received: "AuthMethod=None"
iscsid: 127.0.0.1: target requested transition to operational parameter negotiation
iscsid: 127.0.0.1: beginning operational parameter negotiation
iscsid: 127.0.0.1: Limits for offload "" are MaxRecvDataSegment=262144, max_send_dsl=262144, MaxBurstLength=1048576, FirstBurstLength=1048576
iscsid: 127.0.0.1: key to send: "HeaderDigest=None"
iscsid: 127.0.0.1: key to send: "DataDigest=None"
iscsid: 127.0.0.1: key to send: "MaxRecvDataSegmentLength=262144"
iscsid: 127.0.0.1: key to send: "DefaultTime2Wait=0"
iscsid: 127.0.0.1: key to send: "DefaultTime2Retain=0"
iscsid: 127.0.0.1: key to send: "ErrorRecoveryLevel=0"
iscsid: 127.0.0.1: key received: "HeaderDigest=None"
iscsid: 127.0.0.1: key received: "DataDigest=None"
iscsid: 127.0.0.1: key received: "DefaultTime2Wait=0"
iscsid: 127.0.0.1: key received: "DefaultTime2Retain=0"
iscsid: 127.0.0.1: key received: "ErrorRecoveryLevel=0"
iscsid: 127.0.0.1: key received: "MaxRecvDataSegmentLength=131072"
iscsid: 127.0.0.1: target prefers not to do header digest; we'll comply
iscsid: 127.0.0.1: target prefers not to do data digest; we'll comply
iscsid: 127.0.0.1: operational parameter negotiation done; transitioning to Full Feature phase
iscsid: 127.0.0.1: beginning discovery session
iscsid: 127.0.0.1: key to send: "SendTargets=All"
iscsid: 127.0.0.1: waiting for Text Response
iscsid: 127.0.0.1: key received: "TargetName=iqn.2012-06.com.example:target0"
iscsid: 127.0.0.1: key received: "TargetAddress=127.0.0.1:3260,257"
iscsid: 127.0.0.1: adding target iqn.2012-06.com.example:target0
iscsid: 127.0.0.1: removing temporary discovery session
iscsid: 127.0.0.1: discovery done; logging out
iscsid: 127.0.0.1: waiting for Logout Response
iscsid: 127.0.0.1: discovery session done
iscsid: 127.0.0.1: nothing more to do; exiting
If you (roughly) know how iSCSI works, this will tell you a lot, even if you're not a programmer at all.