Log locking in warning
MODIFY
src/locking/LockingManager.ts
src/locking/LockingManager.ts
-import Lock, { LockEntity, LockType } from '../types/Locking';
+import os from 'os';
+
+import cfenv from 'cfenv';
import BackendError from '../exception/BackendError';
+import LockingStorage from '../storage/mongodb/LockingStorage';
+import Lock, { LockEntity, LockType } from '../types/Locking';
+import { ServerAction } from '../types/Server';
import Configuration from '../utils/Configuration';
import Cypher from '../utils/Cypher';
-import LockingStorage from '../storage/mongodb/LockingStorage';
import Logging from '../utils/Logging';
-import { ServerAction } from '../types/Server';
import Utils from '../utils/Utils';
-import cfenv from 'cfenv';
-import os from 'os';
const MODULE_NAME = 'LockingManager';
@@ -46,14 +47,14 @@ export default class LockingManager {
Utils.isDevelopmentEnv() && console.debug(`Acquire the lock entity '${lock.entity}' ('${lock.key}') of type '${lock.type}' in Tenant ID '${lock.tenantID}'`);
return true;
} catch (error) {
- Logging.logError({
+ Logging.logWarning({
tenantID: lock.tenantID,
module: MODULE_NAME, method: 'acquire',
action: ServerAction.LOCKING,
message: `Cannot acquire the lock entity '${lock.entity}' ('${lock.key}') of type '${lock.type}' in Tenant ID ${lock.tenantID}`,
detailedMessages: { lock, error: error.message, stack: error.stack }
});
- Utils.isDevelopmentEnv() && console.error(`>>>>> Cannot acquire the lock entity '${lock.entity}' ('${lock.key}') of type '${lock.type}' in Tenant ID '${lock.tenantID}'`);
+ Utils.isDevelopmentEnv() && console.warn(`>>>>> Cannot acquire the lock entity '${lock.entity}' ('${lock.key}') of type '${lock.type}' in Tenant ID '${lock.tenantID}'`);
return false;
}
}
@@ -62,7 +63,7 @@ export default class LockingManager {
// Delete
const result = await LockingStorage.deleteLock(lock);
if (!result) {
- Logging.logError({
+ Logging.logWarning({
tenantID: lock.tenantID,
module: MODULE_NAME, method: 'release',
action: ServerAction.LOCKING,

Log locking in warning