Semantic Conventions for Exceptions in Logs
Recording an Exception
To encapsulate proper handling of exceptions API authors MAY provide a
RecordException method/extension, or similar helper mechanism on
LogRecord class/structure or wherever it makes the most sense depending on
the language runtime.
The table below indicates which attributes should be added to the LogRecord and their types.
|string||The exception message.||See below|
|string||A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.||Recommended|
|string||The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.||See below|
Additional attribute requirements: At least one of the following sets of attributes is required: