shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jared Bunting (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SHIRO-391) Enable Principal in Logs using SLF4J MDC
Date Tue, 15 Jan 2013 13:34:12 GMT

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

Jared Bunting resolved SHIRO-391.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0

And of course, "shortly" ends up meaning way too long.  

I've applied this patch, and fixed a test in shiro-guice that it broke  (a mock subject was
unexpectedly getting "getPrincipal" called on it)
                
> Enable Principal in Logs using SLF4J MDC
> ----------------------------------------
>
>                 Key: SHIRO-391
>                 URL: https://issues.apache.org/jira/browse/SHIRO-391
>             Project: Shiro
>          Issue Type: Improvement
>            Reporter: Jan Stamer
>            Assignee: Jared Bunting
>            Priority: Minor
>             Fix For: 1.3.0
>
>         Attachments: ThreadContext.java.patch
>
>
> Sometimes it is useful to log the user name. That way it can easily be traced which user
faced an exception or where an error occurred.
> The Mapped Diagnostic Context (MDC) of SLF4J can be used for that as it uses the same
mechanisms as Shiro already does. That way one can use %X{shiroSubject} in the log pattern.
This will then be filled with the principal name or left blank.
> Remark: No additional libraries or anything are necessary for that. All that's needed
is SLF4J and that's there already.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message