diff --git a/packages/provider/src/api/blacklistRequestInspector.ts b/packages/provider/src/api/blacklistRequestInspector.ts index 6b9ddf6d1..58d4dab03 100644 --- a/packages/provider/src/api/blacklistRequestInspector.ts +++ b/packages/provider/src/api/blacklistRequestInspector.ts @@ -72,11 +72,13 @@ class BlacklistRequestInspector { try { const userIpAddress = getIPAddress(rawIp); + console.log("TEMP IP LOG \n\n", userIpAddress, "\n\n"); const { userId, clientId } = this.extractIdsFromRequest( requestHeaders, requestBody, ); + console.log("TEMP USER ID LOG \n\n", userId, "\n\n"); return await this.blacklistInspector.isUserBlacklisted( clientId, @@ -84,6 +86,7 @@ class BlacklistRequestInspector { userId, ); } catch (err) { + console.error("\n\n---\n\nTEMP ERROR RESOLUTION\n\n---\n\n", err, "\n\nJSON STRINGIFIED\n---\n\n", JSON.stringify(err)); this.logger.error("Block Middleware Error:", err); return true; diff --git a/packages/provider/src/api/block.ts b/packages/provider/src/api/block.ts index 26075f383..cbfbd3726 100644 --- a/packages/provider/src/api/block.ts +++ b/packages/provider/src/api/block.ts @@ -11,13 +11,14 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { getLoggerDefault } from "@prosopo/common"; +import { getLogger, getLoggerDefault } from "@prosopo/common"; import type { ProviderEnvironment } from "@prosopo/types-env"; import { createBlacklistInspector } from "@prosopo/user-access-policy"; import { BlacklistRequestInspector } from "./blacklistRequestInspector.js"; export const blockMiddleware = (providerEnvironment: ProviderEnvironment) => { - const logger = getLoggerDefault(); + const logLevel = providerEnvironment.config.logLevel; + const logger = getLogger(logLevel, "blockMiddleware"); const userAccessRulesStorage = providerEnvironment .getDb()