add logs to license server

This commit is contained in:
Maidul Islam
2024-01-27 12:40:36 +05:30
committed by Akhil Mohan
parent b3f090d87e
commit cec14efe86
@@ -91,11 +91,12 @@ export const licenseServiceFactory = ({
// else it would reach catch statement // else it would reach catch statement
isValidLicense = true; isValidLicense = true;
} catch (error) { } catch (error) {
logger.error(error); logger.error(`init-license: encountered an error when init license [error=${error}]`);
} }
}; };
const getPlan = async (orgId: string, projectId?: string) => { const getPlan = async (orgId: string, projectId?: string) => {
logger.info(`getPlan: attempting to fetch plan for [orgId=${orgId}] [projectId=${projectId}]`);
try { try {
if (instanceType === InstanceType.Cloud) { if (instanceType === InstanceType.Cloud) {
const cachedPlan = featureStore.get<TFeatureSet>(FEATURE_CACHE_KEY(orgId, projectId)); const cachedPlan = featureStore.get<TFeatureSet>(FEATURE_CACHE_KEY(orgId, projectId));
@@ -117,7 +118,7 @@ export const licenseServiceFactory = ({
return currentPlan; return currentPlan;
} }
} catch (error) { } catch (error) {
logger.error(error); logger.error(`getPlan: encountered an error when fetching pan [orgId=${orgId}] [projectId=${projectId}] [error=${error}]`);
return onPremFeatures; return onPremFeatures;
} }
return onPremFeatures; return onPremFeatures;