Almost there. It's:

  logger.error("Failed to format {} (user : {})", param1, param2, ex);

i.e. if the last function parameter is a throwable, it is considered as a provided throwable, not as a format parameter.


  Claude

On 27/03/2017 05:53, chanwook park wrote:
Thanks for your answer.

I understood to randall's comment, but I want to use with multi parameterized variable.
For example,

// usage
logger.error("Failed to format {} (user : {})", ex, param1, param2);

// api
Logger.error(String message, Throwable ex, Object... param)

Is there no way to do this? Or is this problem?


chanwook

On Wed, Mar 22, 2017 at 8:00 PM, <[email protected] <mailto:[email protected]>> wrote:

    Send slf4j-user mailing list submissions to
    [email protected] <mailto:[email protected]>

    To subscribe or unsubscribe via the World Wide Web, visit
    http://mailman.qos.ch/mailman/listinfo/slf4j-user
    <http://mailman.qos.ch/mailman/listinfo/slf4j-user>
    or, via email, send a message with subject or body 'help' to
    [email protected] <mailto:[email protected]>

    You can reach the person managing the list at
    [email protected] <mailto:[email protected]>

    When replying, please edit your Subject line so it is more specific
    than "Re: Contents of slf4j-user digest..."


    Today's Topics:

       1. Re: slf4j-user Digest, Vol 56, Issue 13 (Randall Wood)


    ----------------------------------------------------------------------

    Message: 1
    Date: Tue, 21 Mar 2017 07:06:01 -0400
    From: Randall Wood <[email protected]
    <mailto:[email protected]>>
    To: [email protected] <mailto:[email protected]>
    Subject: Re: [slf4j-user] slf4j-user Digest, Vol 56, Issue 13
    Message-ID:
<[email protected]
    <mailto:[email protected]>>
    Content-Type: text/plain; charset="utf-8"


    > I don't see the javadoc describing that behavior.
    > https://www.slf4j.org/api/org/slf4j/Logger.html
    <https://www.slf4j.org/api/org/slf4j/Logger.html>
    <https://www.slf4j.org/api/org/slf4j/Logger.html
    <https://www.slf4j.org/api/org/slf4j/Logger.html>>

    That Javadoc reads "Be sure to read the FAQ entry relating to
    parameterized logging
    <https://www.slf4j.org/faq.html#logging_performance
    <https://www.slf4j.org/faq.html#logging_performance>>. Note that
    logging statements can be parameterized in presence of an
    exception/throwable <https://www.slf4j.org/faq.html#paramException
    <https://www.slf4j.org/faq.html#paramException>>.” and links to
    https://www.slf4j.org/faq.html#paramException
    <https://www.slf4j.org/faq.html#paramException>
    <https://www.slf4j.org/faq.html#paramException
    <https://www.slf4j.org/faq.html#paramException>> which describes
    that behavior (which applies to all levels of logging with slf4j).

    Randall
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL:
    
<http://mailman.qos.ch/pipermail/slf4j-user/attachments/20170321/4f279862/attachment-0001.html
    
<http://mailman.qos.ch/pipermail/slf4j-user/attachments/20170321/4f279862/attachment-0001.html>>

    ------------------------------

    Subject: Digest Footer

    _______________________________________________
    slf4j-user mailing list
    [email protected] <mailto:[email protected]>
    http://mailman.qos.ch/mailman/listinfo/slf4j-user
    <http://mailman.qos.ch/mailman/listinfo/slf4j-user>

    ------------------------------

    End of slf4j-user Digest, Vol 56, Issue 14
    ******************************************




--
===============================================
박 찬욱 Chanwook Park

Phone :: 010-9019-2553

Github :: https://github.com/chanwookpark
Blog :: http://chanwookpark.github.io
LinkedIn :: https://www.linkedin.com/in/chanwook-park-47304148
===============================================


_______________________________________________
slf4j-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/slf4j-user

_______________________________________________
slf4j-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/slf4j-user

Reply via email to