Skip to content

Message interpolation and exceptions - problem #216

Closed
@zorba128

Description

@zorba128

Just noticed
val e = new RuntimeException(...)
log.info(s"exc: $e")
and
log.info(s"exc: ${e.toString}")
end up with different log messages.

Due to string interpolation conversion error, first one produces:
"exc: {}
java.lang.RuntimeException: Exception
at ...
"
Probbably $e is not treated as argument to slf4j's interpolation, but as exception argument.
So interpolation doesn't work, and one gets unwanted stacktrace.

marcin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions