Skip to content

UnknownFormatConversionException when FULL logging some IOExceptions #613

Description

@jvanderhoek

Some IOExceptions actually contain a '%' sign which trips the String.format function used by Logger.
logIOException logs the exception stacktrace as a format string, rather than an argument to the "%s" format.

For example:

<--- ERROR HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1, localhost/fe80:0:0:0:0:0:0:1%1] failed: Connection refused (Connection refused) (2174ms)

java.util.UnknownFormatConversionException: Conversion = '1'

	at java.util.Formatter.checkText(Formatter.java:2579)
	at java.util.Formatter.parse(Formatter.java:2565)
	at java.util.Formatter.format(Formatter.java:2501)
	at java.util.Formatter.format(Formatter.java:2455)
	at java.lang.String.format(String.java:2940)
	at feign.slf4j.Slf4jLogger.log(Slf4jLogger.java:72)
	at feign.Logger.logIOException(Logger.java:119)

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