You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by Михаил Голод <mi...@gmail.com> on 2012/02/19 22:23:39 UTC

Misuse of slf4j logging api in DefaultSecurityManager

Today I was going through Shiro Tutorial. And small thing attracted my attention in logging output at DEBUG level.  I've downloaded sources and fix it. Here is the patch against current trunk

Index: src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java
===================================================================
--- src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java	(revision 1291058)
+++ src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java	(working copy)
@@ -547,7 +547,7 @@
         PrincipalCollection principals = subject.getPrincipals();
         if (principals != null && !principals.isEmpty()) {
             if (log.isDebugEnabled()) {
-                log.debug("Logging out subject with primary principal {}" + principals.getPrimaryPrincipal());
+                log.debug("Logging out subject with primary principal {}", principals.getPrimaryPrincipal());
             }
             Authenticator authc = getAuthenticator();
             if (authc instanceof LogoutAware) {

It's not important anyway, just to make things look nicer ;)

Best regards,
Mike Golod




Re: Misuse of slf4j logging api in DefaultSecurityManager

Posted by Les Hazlewood <lh...@apache.org>.
Thanks!

On Sun, Feb 19, 2012 at 1:23 PM, Михаил Голод <mi...@gmail.com> wrote:
> Today I was going through Shiro Tutorial. And small thing attracted my attention in logging output at DEBUG level.  I've downloaded sources and fix it. Here is the patch against current trunk
>
> Index: src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java
> ===================================================================
> --- src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java      (revision 1291058)
> +++ src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java      (working copy)
> @@ -547,7 +547,7 @@
>         PrincipalCollection principals = subject.getPrincipals();
>         if (principals != null && !principals.isEmpty()) {
>             if (log.isDebugEnabled()) {
> -                log.debug("Logging out subject with primary principal {}" + principals.getPrimaryPrincipal());
> +                log.debug("Logging out subject with primary principal {}", principals.getPrimaryPrincipal());
>             }
>             Authenticator authc = getAuthenticator();
>             if (authc instanceof LogoutAware) {
>
> It's not important anyway, just to make things look nicer ;)
>
> Best regards,
> Mike Golod