Updated logs with connector id
MODIFY
src/client/ocpi/EmspOCPIClient.ts
src/client/ocpi/EmspOCPIClient.ts
@@ -496,7 +496,7 @@ export default class EmspOCPIClient extends OCPIClient {
throw new BackendError({
action: ServerAction.OCPI_START_SESSION,
source: chargingStation.id,
- message: `Connector '${connectorId}' > OCPI Remote Start Session is not available for Tag ID '${tagId}'`,
+ message: `Connector ID '${connectorId}' > OCPI Remote Start Session is not available for Tag ID '${tagId}'`,
module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { tag: tag }
});
@@ -524,7 +524,7 @@ export default class EmspOCPIClient extends OCPIClient {
tenantID: this.tenant.id,
action: ServerAction.OCPI_START_SESSION,
source: chargingStation.id,
- message: `Connector '${connectorId}' > OCPI Remote Start Session with Tad ID '${tagId}' at ${commandUrl}`,
+ message: `Connector ID '${connectorId}' > OCPI Remote Start Session with Tad ID '${tagId}' at ${commandUrl}`,
module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { payload }
});
@@ -540,7 +540,7 @@ export default class EmspOCPIClient extends OCPIClient {
tenantID: this.tenant.id,
action: ServerAction.OCPI_START_SESSION,
source: chargingStation.id,
- message: `Connector '${connectorId}' > OCPI Remote Start session response status ${response.status}`,
+ message: `Connector ID '${connectorId}' > OCPI Remote Start session response status ${response.status}`,
module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { response: response.data }
});
@@ -570,7 +570,7 @@ export default class EmspOCPIClient extends OCPIClient {
tenantID: this.tenant.id,
action: ServerAction.OCPI_STOP_SESSION,
source: transaction.chargeBoxID,
- message: `Connector '${transaction.connectorId}' > OCPI Remote Stop Session ID '${transactionId}' at ${commandUrl}`,
+ message: `Connector ID '${transaction.connectorId}' > OCPI Remote Stop Session ID '${transactionId}' at ${commandUrl}`,
module: MODULE_NAME, method: 'remoteStopSession',
detailedMessages: { payload }
});

MODIFY
src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts
src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts
@@ -441,7 +441,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)}'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)}'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});
@@ -468,7 +468,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)}'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)}'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});
@@ -615,7 +615,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)} in DB'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)} in DB'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});
@@ -633,7 +633,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)} in DB'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)} in DB'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});
@@ -652,7 +652,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)} in DB'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)} in DB'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});

MODIFY
src/server/ocpp/services/OCPPService.ts
src/server/ocpp/services/OCPPService.ts
@@ -295,7 +295,7 @@ export default class OCPPService {
source: chargingStation.id,
action: ServerAction.STATUS_NOTIFICATION,
module: MODULE_NAME, method: 'handleStatusNotification',
- message: `Connector '0' > Received Status: '${statusNotification.status}' - '${statusNotification.errorCode}' - '${statusNotification.info}'`
+ message: `Connector ID '0' > Received Status: '${statusNotification.status}' - '${statusNotification.errorCode}' - '${statusNotification.info}'`
});
}
// Respond
@@ -392,7 +392,7 @@ export default class OCPPService {
action: ServerAction.METER_VALUES,
user: transaction.userID,
module: MODULE_NAME, method: 'handleMeterValues',
- message: `Connector '${meterValues.connectorId}' > Transaction ID '${meterValues.transactionId}' > MeterValue have been saved`,
+ message: `Connector ID '${meterValues.connectorId}' > Transaction ID '${meterValues.transactionId}' > MeterValue have been saved`,
detailedMessages: { normalizedMeterValues }
});
} else {
@@ -402,7 +402,7 @@ export default class OCPPService {
source: chargingStation.id,
action: ServerAction.METER_VALUES,
module: MODULE_NAME, method: 'handleMeterValues',
- message: `Connector '${meterValues.connectorId}' > Meter Values are ignored as it is not linked to a transaction`,
+ message: `Connector ID '${meterValues.connectorId}' > Meter Values are ignored as it is not linked to a transaction`,
detailedMessages: { normalizedMeterValues }
});
}
@@ -671,7 +671,7 @@ export default class OCPPService {
source: chargingStation.id,
module: MODULE_NAME, method: 'handleStartTransaction',
action: ServerAction.START_TRANSACTION, user: user,
- message: `Connector '${transaction.connectorId}' > Transaction ID '${transaction.id}' has been started`
+ message: `Connector ID '${transaction.connectorId}' > Transaction ID '${transaction.id}' has been started`
});
} else {
// Log
@@ -680,7 +680,7 @@ export default class OCPPService {
source: chargingStation.id,
module: MODULE_NAME, method: 'handleStartTransaction',
action: ServerAction.START_TRANSACTION,
- message: `Connector '${transaction.connectorId}' > Transaction ID '${transaction.id}' has been started`
+ message: `Connector ID '${transaction.connectorId}' > Transaction ID '${transaction.id}' has been started`
});
}
// Return
@@ -865,7 +865,7 @@ export default class OCPPService {
action: ServerAction.STOP_TRANSACTION,
user: (alternateUser ? alternateUser : (user ? user : null)),
actionOnUser: (alternateUser ? (user ? user : null) : null),
- message: `Connector '${transaction.connectorId}' > Transaction ID '${transaction.id}' has been stopped successfully`
+ message: `Connector ID '${transaction.connectorId}' > Transaction ID '${transaction.id}' has been stopped successfully`
});
// Success
return {
@@ -897,7 +897,7 @@ export default class OCPPService {
tenantID: tenantID,
source: transaction.chargeBoxID,
action: ServerAction.CHARGING_PROFILE_DELETE,
- message: `Connector '${transaction.connectorId}' > Transaction ID '${transaction.id}' > TX Charging Profile with ID '${chargingProfile.id}'`,
+ message: `Connector ID '${transaction.connectorId}' > Transaction ID '${transaction.id}' > TX Charging Profile with ID '${chargingProfile.id}'`,
module: MODULE_NAME, method: 'handleStopTransaction',
detailedMessages: { chargingProfile }
});
@@ -906,7 +906,7 @@ export default class OCPPService {
tenantID: tenantID,
source: transaction.chargeBoxID,
action: ServerAction.CHARGING_PROFILE_DELETE,
- message: `Connector '${transaction.connectorId}' > Transaction ID '${transaction.id}' > Cannot delete TX Charging Profile with ID '${chargingProfile.id}'`,
+ message: `Connector ID '${transaction.connectorId}' > Transaction ID '${transaction.id}' > Cannot delete TX Charging Profile with ID '${chargingProfile.id}'`,
module: MODULE_NAME, method: 'handleStopTransaction',
detailedMessages: { error: error.message, stack: error.stack, chargingProfile }
});
@@ -948,7 +948,7 @@ export default class OCPPService {
source: chargingStation.id,
module: MODULE_NAME, method: 'updateConnectorStatus',
action: ServerAction.STATUS_NOTIFICATION,
- message: `Connector '${statusNotification.connectorId}' > Transaction ID '${foundConnector.currentTransactionID}' > Status has not changed then not saved: '${statusNotification.status}' - '${statusNotification.errorCode}' - '${(statusNotification.info ? statusNotification.info : 'N/A')}''`,
+ message: `Connector ID '${statusNotification.connectorId}' > Transaction ID '${foundConnector.currentTransactionID}' > Status has not changed then not saved: '${statusNotification.status}' - '${statusNotification.errorCode}' - '${(statusNotification.info ? statusNotification.info : 'N/A')}''`,
detailedMessages: { connector: foundConnector }
});
return;
@@ -972,7 +972,7 @@ export default class OCPPService {
source: chargingStation.id,
module: MODULE_NAME, method: 'updateConnectorStatus',
action: ServerAction.STATUS_NOTIFICATION,
- message: `Connector '${statusNotification.connectorId}' > Transaction ID '${foundConnector.currentTransactionID}' > Status: '${statusNotification.status}' - '${statusNotification.errorCode}' - '${(statusNotification.info ? statusNotification.info : 'N/A')}' has been saved`,
+ message: `Connector ID '${statusNotification.connectorId}' > Transaction ID '${foundConnector.currentTransactionID}' > Status: '${statusNotification.status}' - '${statusNotification.errorCode}' - '${(statusNotification.info ? statusNotification.info : 'N/A')}' has been saved`,
detailedMessages: [statusNotification, foundConnector]
});
// Check if transaction is ongoing (ABB bug)!!!
@@ -1036,7 +1036,7 @@ export default class OCPPService {
user: lastTransaction.userID,
module: MODULE_NAME, method: 'checkStatusNotificationExtraInactivity',
action: ServerAction.EXTRA_INACTIVITY,
- message: `Connector '${lastTransaction.connectorId}' > Transaction ID '${lastTransaction.id}' > Extra Inactivity of ${lastTransaction.stop.extraInactivitySecs} secs has been added`,
+ message: `Connector ID '${lastTransaction.connectorId}' > Transaction ID '${lastTransaction.id}' > Extra Inactivity of ${lastTransaction.stop.extraInactivitySecs} secs has been added`,
detailedMessages: [statusNotification, lastTransaction]
});
} else {
@@ -1047,7 +1047,7 @@ export default class OCPPService {
user: lastTransaction.userID,
module: MODULE_NAME, method: 'checkStatusNotificationExtraInactivity',
action: ServerAction.EXTRA_INACTIVITY,
- message: `Connector '${lastTransaction.connectorId}' > Transaction ID '${lastTransaction.id}' > Extra Inactivity has already been computed`,
+ message: `Connector ID '${lastTransaction.connectorId}' > Transaction ID '${lastTransaction.id}' > Extra Inactivity has already been computed`,
detailedMessages: [statusNotification, lastTransaction]
});
}
@@ -1073,7 +1073,7 @@ export default class OCPPService {
user: lastTransaction.userID,
module: MODULE_NAME, method: 'checkStatusNotificationExtraInactivity',
action: ServerAction.EXTRA_INACTIVITY,
- message: `Connector '${lastTransaction.connectorId}' > Transaction ID '${lastTransaction.id}' > No Extra Inactivity has been added`,
+ message: `Connector ID '${lastTransaction.connectorId}' > Transaction ID '${lastTransaction.id}' > No Extra Inactivity has been added`,
detailedMessages: [statusNotification, lastTransaction]
});
}
@@ -1123,7 +1123,7 @@ export default class OCPPService {
source: chargingStation.id,
action: ServerAction.STATUS_NOTIFICATION,
module: MODULE_NAME, method: 'notifyStatusNotification',
- message: `Connector '${statusNotification.connectorId}' > Error occurred : '${statusNotification.status}' - '${statusNotification.errorCode}' - '${(statusNotification.info ? statusNotification.info : 'N/A')}'`
+ message: `Connector ID '${statusNotification.connectorId}' > Error occurred : '${statusNotification.status}' - '${statusNotification.errorCode}' - '${(statusNotification.info ? statusNotification.info : 'N/A')}'`
});
// Send Notification (Async)
NotificationHandler.sendChargingStationStatusError(
@@ -1333,7 +1333,7 @@ export default class OCPPService {
module: MODULE_NAME, method: 'updateChargingStationWithTransaction',
action: ServerAction.CONSUMPTION,
user: transaction.userID,
- message: `Connector '${foundConnector.connectorId}' > Transaction ID '${foundConnector.currentTransactionID}' > Instant: ${Utils.getRoundedNumberToTwoDecimals(foundConnector.currentInstantWatts / 1000)} kW, Total: ${Utils.getRoundedNumberToTwoDecimals(foundConnector.currentTotalConsumptionWh / 1000)} kW.h${foundConnector.currentStateOfCharge ? ', SoC: ' + foundConnector.currentStateOfCharge.toString() + ' %' : ''}`
+ message: `Connector ID '${foundConnector.connectorId}' > Transaction ID '${foundConnector.currentTransactionID}' > Instant: ${Utils.getRoundedNumberToTwoDecimals(foundConnector.currentInstantWatts / 1000)} kW, Total: ${Utils.getRoundedNumberToTwoDecimals(foundConnector.currentTotalConsumptionWh / 1000)} kW.h${foundConnector.currentStateOfCharge ? ', SoC: ' + foundConnector.currentStateOfCharge.toString() + ' %' : ''}`
});
// Cleanup connector transaction data
} else if (foundConnector) {
@@ -1573,7 +1573,7 @@ export default class OCPPService {
module: MODULE_NAME, method: 'stopOrDeleteActiveTransactions',
action: ServerAction.CLEANUP_TRANSACTION,
actionOnUser: activeTransaction.user,
- message: `Connector '${activeTransaction.connectorId}' > Pending Transaction ID '${activeTransaction.id}' with no consumption has been deleted`
+ message: `Connector ID '${activeTransaction.connectorId}' > Pending Transaction ID '${activeTransaction.id}' with no consumption has been deleted`
});
// Delete
await TransactionStorage.deleteTransaction(tenantID, activeTransaction.id);
@@ -1597,7 +1597,7 @@ export default class OCPPService {
module: MODULE_NAME, method: 'stopOrDeleteActiveTransactions',
action: ServerAction.CLEANUP_TRANSACTION,
actionOnUser: activeTransaction.userID,
- message: `Connector '${activeTransaction.connectorId}' > Cannot delete pending Transaction ID '${activeTransaction.id}' with no consumption`
+ message: `Connector ID '${activeTransaction.connectorId}' > Cannot delete pending Transaction ID '${activeTransaction.id}' with no consumption`
});
} else {
// Has consumption: close it!
@@ -1607,7 +1607,7 @@ export default class OCPPService {
module: MODULE_NAME, method: 'stopOrDeleteActiveTransactions',
action: ServerAction.CLEANUP_TRANSACTION,
actionOnUser: activeTransaction.userID,
- message: `Connector '${activeTransaction.connectorId}' > Pending Transaction ID '${activeTransaction.id}' has been stopped`
+ message: `Connector ID '${activeTransaction.connectorId}' > Pending Transaction ID '${activeTransaction.id}' has been stopped`
});
}
}

MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -1390,14 +1390,14 @@ export default class OCPPUtils {
detailedMessages: { result, chargingProfile },
});
}
- // Save
+ // Saves
const chargingProfileID = await ChargingStationStorage.saveChargingProfile(tenantID, chargingProfile);
Logging.logInfo({
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.CHARGING_PROFILE_UPDATE,
module: MODULE_NAME, method: 'setAndSaveChargingProfile',
- message: 'Charging Profile has been successfully pushed and saved',
+ message: `Connector ID '${chargingProfile.connectorID}' > Charging Profile has been successfully pushed and saved`,
detailedMessages: { chargingProfile }
});
return chargingProfileID;

MODIFY
src/server/rest/service/TransactionService.ts
src/server/rest/service/TransactionService.ts
@@ -426,7 +426,7 @@ export default class TransactionService {
source: chargingStation.id,
user: req.user, actionOnUser: user,
module: MODULE_NAME, method: 'handleTransactionSoftStop',
- message: `Connector '${transaction.connectorId}' > Transaction ID '${transactionId}' has been stopped successfully`,
+ message: `Connector ID '${transaction.connectorId}' > Transaction ID '${transactionId}' has been stopped successfully`,
action: action,
detailedMessages: { result }
});

Updated logs with connector id