casbin / jcasbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Java
https://casbin.org
Apache License 2.0
2.38k stars 461 forks source link

Failed to load class "org.slf4j.impl.StaticLoggerBinder". #165

Closed divyagar closed 3 years ago

divyagar commented 3 years ago

While running basic permission checking code provided in tutorial:

Enforcer e = new Enforcer("basic_model.conf", "basic_policy.csv");
String sub = "alice"; // the user that wants to access a resource.
String obj = "data1"; // the resource that is going to be accessed.
String act = "read"; // the operation that the user performs on the resource.

if (e.enforce(sub, obj, act) == true) {
   // permit alice to read data1
   System.out.println("permit alice to read data1");
} else {
   // deny the request, show an error
   System.out.println("permission denied");
}

compiler is showing following error followed by result of above code:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
permit alice to read data1
shy1st commented 3 years ago

please add the following dependency. @divyagar 捕获

hsluoyz commented 3 years ago

@shy1st can we fix this warning for users don't use slf4j?

divyagar commented 3 years ago

@hsluoyz Can we add dependency of slf4 in installation section as a requirement to make user aware that this library is being used in jcasbin?

hsluoyz commented 3 years ago

:tada: This issue has been resolved in version 1.8.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: