You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Matthias Pohl (Jira)" <ji...@apache.org> on 2022/11/25 01:41:00 UTC

[jira] [Assigned] (FLINK-30179) Stop stringifying exception for logging

     [ https://issues.apache.org/jira/browse/FLINK-30179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Pohl reassigned FLINK-30179:
-------------------------------------

    Assignee: Mingliang Liu

> Stop stringifying exception for logging
> ---------------------------------------
>
>                 Key: FLINK-30179
>                 URL: https://issues.apache.org/jira/browse/FLINK-30179
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Task
>    Affects Versions: 1.16.0
>            Reporter: Mingliang Liu
>            Assignee: Mingliang Liu
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.17.0
>
>
> In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places where we stringify an exception before logging. According to Slf4j logging, we can just leave the last argument as exception (or throwable) without fitting them into log message string with placeholders ([doc|https://www.slf4j.org/faq.html]). Let Slf4j handles the last exception parameter is good as tooling can treat that differently. Our logging tool does not truncate the exception but truncates log message message.
> So essentially:
> {code:java}
> LOG.debug(
>         "{} ({}) switched from {} to {} due to CancelTaskException: {}",
>         taskNameWithSubtask,
>         executionId,
>         currentState,
>         newState,
>         ExceptionUtils.stringifyException(cause));
> {code}
> should be
> {code:java}
> LOG.debug(
>         "{} ({}) switched from {} to {} due to CancelTaskException:",
>         taskNameWithSubtask,
>         executionId,
>         currentState,
>         newState,
>         cause);
> {code}
> Interestingly there was a [hot fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae] that deliberately changed the code from the latter to the former. This JIRA can track the discussion why that was needed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)