Many programs will be outputting the their errors directly onto stdout/stderr, and then ingesting these logs with some form of log aggregation tool (Logstash/Splunk/...). With multi-line errors, this requires configuring these tools to recognize log entries spanning multiple lines. To make this easier, it might make sense to have a common prefix on all following lines, rather than alternating spaces and triple-dash as in the examples:
write users database:
more detail here
/path/to/database.go:111
--- call myserver.Method:
/path/to/grpc.go:222
--- dial myserver:3333:
/path/to/net/dial.go:333