killbill-memoizeit
Changes
catalog/src/main/java/org/killbill/billing/catalog/caching/CatalogCacheInvalidationCallback.java 2(+1 -1)
catalog/src/main/java/org/killbill/billing/catalog/provider/DefaultCatalogProviderPluginRegistry.java 4(+2 -2)
currency/src/main/java/org/killbill/billing/currency/DefaultCurrencyProviderPluginRegistry.java 4(+2 -2)
entitlement/src/main/java/org/killbill/billing/entitlement/api/svcs/DefaultEntitlementApiBase.java 4(+2 -2)
entitlement/src/main/java/org/killbill/billing/entitlement/dao/DefaultBlockingStateDao.java 2(+1 -1)
entitlement/src/main/java/org/killbill/billing/entitlement/provider/DefaultEntitlementProviderPluginRegistry.java 4(+2 -2)
invoice/src/main/java/org/killbill/billing/invoice/generator/FixedAndRecurringInvoiceItemGenerator.java 7(+4 -3)
invoice/src/main/java/org/killbill/billing/invoice/notification/DefaultNextBillingDateNotifier.java 42(+19 -23)
invoice/src/main/java/org/killbill/billing/invoice/provider/DefaultInvoiceProviderPluginRegistry.java 4(+2 -2)
invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceFormatter.java 4(+2 -2)
junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java 2(+1 -1)
junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java 2(+1 -1)
overdue/src/main/java/org/killbill/billing/overdue/applicator/OverdueStateApplicator.java 36(+26 -10)
overdue/src/main/java/org/killbill/billing/overdue/caching/OverdueCacheInvalidationCallback.java 2(+1 -1)
payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentAttemptTask.java 10(+5 -5)
payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentTransactionTask.java 5(+2 -3)
payment/src/main/java/org/killbill/billing/payment/core/PluginControlPaymentProcessor.java 12(+6 -6)
payment/src/main/java/org/killbill/billing/payment/core/sm/control/ControlPluginRunner.java 6(+3 -3)
payment/src/main/java/org/killbill/billing/payment/core/sm/control/OperationControlCallback.java 9(+4 -5)
payment/src/main/java/org/killbill/billing/payment/core/sm/payments/PaymentEnteringStateCallback.java 2(+1 -1)
payment/src/main/java/org/killbill/billing/payment/invoice/InvoicePaymentControlPluginApi.java 16(+7 -9)
payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentControlProviderPluginRegistry.java 4(+2 -2)
payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentProviderPluginRegistry.java 4(+2 -2)
profiles/killbill/src/main/java/org/killbill/billing/server/filters/ProfilingContainerResponseFilter.java 2(+1 -1)
profiles/killbill/src/main/java/org/killbill/billing/server/notifications/PushNotificationListener.java 2(+1 -1)
subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java 2(+1 -1)
subscription/src/main/java/org/killbill/billing/subscription/engine/core/DefaultSubscriptionBaseService.java 12(+6 -6)
subscription/src/main/java/org/killbill/billing/subscription/engine/dao/DefaultSubscriptionDao.java 14(+7 -7)
Details
diff --git a/account/src/main/java/org/killbill/billing/account/dao/DefaultAccountDao.java b/account/src/main/java/org/killbill/billing/account/dao/DefaultAccountDao.java
index 19eb29a..fbbdcc7 100644
--- a/account/src/main/java/org/killbill/billing/account/dao/DefaultAccountDao.java
+++ b/account/src/main/java/org/killbill/billing/account/dao/DefaultAccountDao.java
@@ -94,7 +94,7 @@ public class DefaultAccountDao extends EntityDaoBase<AccountModelDao, Account, A
try {
eventBus.postFromTransaction(creationEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post account creation event for account " + savedAccount.getId(), e);
+ log.warn(String.format("Failed to post account creation event for accountId='%s'", savedAccount.getId()), e);
}
}
@@ -166,7 +166,7 @@ public class DefaultAccountDao extends EntityDaoBase<AccountModelDao, Account, A
try {
eventBus.postFromTransaction(changeEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post account change event for account " + accountId, e);
+ log.warn(String.format("Failed to post account change event for accountId='%s'", accountId), e);
}
return null;
@@ -205,7 +205,7 @@ public class DefaultAccountDao extends EntityDaoBase<AccountModelDao, Account, A
try {
eventBus.postFromTransaction(changeEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post account change event for account " + accountId, e);
+ log.warn(String.format("Failed to post account change event for accountId='%s'", accountId), e);
}
return null;
}
diff --git a/beatrix/src/main/java/org/killbill/billing/beatrix/extbus/BeatrixListener.java b/beatrix/src/main/java/org/killbill/billing/beatrix/extbus/BeatrixListener.java
index 31389da..b3d547a 100644
--- a/beatrix/src/main/java/org/killbill/billing/beatrix/extbus/BeatrixListener.java
+++ b/beatrix/src/main/java/org/killbill/billing/beatrix/extbus/BeatrixListener.java
@@ -106,10 +106,10 @@ public class BeatrixListener {
// However when using InMemoryBus, this can happen as there is no retry logic (at the 'ext' bus level) and so we should re-throw at this level to kick-in the retry logic from the 'main' bus
// (The use of RuntimeException is somewhat arbitrary)
//
- log.warn("Failed to dispatch external bus events", e);
+ log.warn(String.format("Failed to post event %s", event), e);
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
- log.warn("Failed to dispatch external bus events", e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/caching/CatalogCacheInvalidationCallback.java b/catalog/src/main/java/org/killbill/billing/catalog/caching/CatalogCacheInvalidationCallback.java
index 63548dc..852cd06 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/caching/CatalogCacheInvalidationCallback.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/caching/CatalogCacheInvalidationCallback.java
@@ -38,7 +38,7 @@ public class CatalogCacheInvalidationCallback implements CacheInvalidationCallba
@Override
public void invalidateCache(TenantKey key, final Object cookie, final InternalTenantContext tenantContext) {
- log.info("Invalidate catalog cache for tenant {} ", tenantContext.getTenantRecordId());
+ log.info("Invalidate catalog cache for tenantRecordId='{}'", tenantContext.getTenantRecordId());
catalogCache.clearCatalog(tenantContext);
}
}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/caching/EhCacheCatalogCache.java b/catalog/src/main/java/org/killbill/billing/catalog/caching/EhCacheCatalogCache.java
index 44e704d..5713049 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/caching/EhCacheCatalogCache.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/caching/EhCacheCatalogCache.java
@@ -155,7 +155,7 @@ public class EhCacheCatalogCache implements CatalogCache {
this.defaultCatalog = loader.loadDefaultCatalog("EmptyCatalog.xml");
} catch (final CatalogApiException e) {
this.defaultCatalog = new VersionedCatalog();
- logger.warn("Exception loading EmptyCatalog - should never happen!", e);
+ logger.error("Exception loading EmptyCatalog - should never happen!", e);
}
}
}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultCatalogService.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultCatalogService.java
index 053122c..cf17853 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultCatalogService.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultCatalogService.java
@@ -72,7 +72,7 @@ public class DefaultCatalogService implements KillbillService, CatalogService {
// In multi-tenant mode, the property is not required
if (config.getCatalogURI() != null && !config.getCatalogURI().isEmpty()) {
catalogCache.loadDefaultCatalog(config.getCatalogURI());
- log.info("Successfully loaded the default catalog " + config.getCatalogURI());
+ log.info("Successfully loaded the default catalog {}", config.getCatalogURI());
}
isInitialized = true;
} catch (Exception e) {
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/provider/DefaultCatalogProviderPluginRegistry.java b/catalog/src/main/java/org/killbill/billing/catalog/provider/DefaultCatalogProviderPluginRegistry.java
index e7e4005..d29ce36 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/provider/DefaultCatalogProviderPluginRegistry.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/provider/DefaultCatalogProviderPluginRegistry.java
@@ -41,13 +41,13 @@ public class DefaultCatalogProviderPluginRegistry implements OSGIServiceRegistra
@Override
public void registerService(final OSGIServiceDescriptor desc, final CatalogPluginApi service) {
- log.info("DefaultInvoiceProviderPluginRegistry registering service " + desc.getRegistrationName());
+ log.info("Registering service='{}'", desc.getRegistrationName());
pluginsByName.put(desc.getRegistrationName(), service);
}
@Override
public void unregisterService(final String serviceName) {
- log.info("DefaultInvoiceProviderPluginRegistry unregistering service " + serviceName);
+ log.info("Unregistering service='{}'", serviceName);
pluginsByName.remove(serviceName);
}
diff --git a/currency/src/main/java/org/killbill/billing/currency/DefaultCurrencyProviderPluginRegistry.java b/currency/src/main/java/org/killbill/billing/currency/DefaultCurrencyProviderPluginRegistry.java
index abb6abd..310eb05 100644
--- a/currency/src/main/java/org/killbill/billing/currency/DefaultCurrencyProviderPluginRegistry.java
+++ b/currency/src/main/java/org/killbill/billing/currency/DefaultCurrencyProviderPluginRegistry.java
@@ -42,13 +42,13 @@ public class DefaultCurrencyProviderPluginRegistry implements OSGIServiceRegistr
@Override
public void registerService(final OSGIServiceDescriptor desc, final CurrencyPluginApi service) {
- log.info("DefaultCurrencyProviderPluginRegistry registering service " + desc.getRegistrationName());
+ log.info("Registering service='{}'", desc.getRegistrationName());
pluginsByName.put(desc.getRegistrationName(), service);
}
@Override
public void unregisterService(final String serviceName) {
- log.info("DefaultCurrencyProviderPluginRegistry unregistering service " + serviceName);
+ log.info("Unregistering service='{}'", serviceName);
pluginsByName.remove(serviceName);
}
diff --git a/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionApi.java b/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionApi.java
index e74f7ef..c0d67e4 100644
--- a/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionApi.java
+++ b/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionApi.java
@@ -204,7 +204,7 @@ public class DefaultSubscriptionApi implements SubscriptionApi {
try {
return getSubscriptionBundle(subscriptionBaseBundle.getId(), context);
} catch (final SubscriptionApiException e) {
- log.warn("Error retrieving subscription", e);
+ log.warn(String.format("Error retrieving bundleId='%s'", subscriptionBaseBundle.getId()), e);
return null;
}
}
@@ -228,7 +228,7 @@ public class DefaultSubscriptionApi implements SubscriptionApi {
try {
return getSubscriptionBundle(subscriptionBaseBundle.getId(), context);
} catch (final SubscriptionApiException e) {
- log.warn("Error retrieving subscription", e);
+ log.warn(String.format("Error retrieving bundleId='%s'", subscriptionBaseBundle.getId()), e);
return null;
}
}
diff --git a/entitlement/src/main/java/org/killbill/billing/entitlement/api/svcs/DefaultEntitlementApiBase.java b/entitlement/src/main/java/org/killbill/billing/entitlement/api/svcs/DefaultEntitlementApiBase.java
index 1198f44..dd7dfc0 100644
--- a/entitlement/src/main/java/org/killbill/billing/entitlement/api/svcs/DefaultEntitlementApiBase.java
+++ b/entitlement/src/main/java/org/killbill/billing/entitlement/api/svcs/DefaultEntitlementApiBase.java
@@ -189,7 +189,7 @@ public class DefaultEntitlementApiBase {
try {
eventBus.post(event);
} catch (EventBusException e) {
- log.warn("Failed to post bus event for pause operation on bundle " + bundleId);
+ log.warn(String.format("Failed to post event %s", event), e);
}
} catch (SubscriptionBaseApiException e) {
@@ -241,7 +241,7 @@ public class DefaultEntitlementApiBase {
try {
eventBus.post(event);
} catch (EventBusException e) {
- log.warn("Failed to post bus event for resume operation on bundle " + bundleId);
+ log.warn(String.format("Failed to post event %s", event), e);
}
} catch (SubscriptionBaseApiException e) {
diff --git a/entitlement/src/main/java/org/killbill/billing/entitlement/dao/DefaultBlockingStateDao.java b/entitlement/src/main/java/org/killbill/billing/entitlement/dao/DefaultBlockingStateDao.java
index cb1551e..36edc48 100644
--- a/entitlement/src/main/java/org/killbill/billing/entitlement/dao/DefaultBlockingStateDao.java
+++ b/entitlement/src/main/java/org/killbill/billing/entitlement/dao/DefaultBlockingStateDao.java
@@ -334,7 +334,7 @@ public class DefaultBlockingStateDao extends EntityDaoBase<BlockingStateModelDao
try {
eventBus.postFromTransaction(event, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post event {}", e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
diff --git a/entitlement/src/main/java/org/killbill/billing/entitlement/DefaultEntitlementService.java b/entitlement/src/main/java/org/killbill/billing/entitlement/DefaultEntitlementService.java
index 8369a8a..5810af6 100644
--- a/entitlement/src/main/java/org/killbill/billing/entitlement/DefaultEntitlementService.java
+++ b/entitlement/src/main/java/org/killbill/billing/entitlement/DefaultEntitlementService.java
@@ -107,7 +107,7 @@ public class DefaultEntitlementService implements EntitlementService {
} else if (inputKey instanceof BlockingTransitionNotificationKey) {
processBlockingNotification((BlockingTransitionNotificationKey) inputKey, internalCallContext);
} else if (inputKey != null) {
- log.error("Entitlement service received an unexpected event type {}" + inputKey.getClass());
+ log.error("Entitlement service received an unexpected event className='{}", inputKey.getClass());
} else {
log.error("Entitlement service received an unexpected null event");
}
@@ -127,12 +127,12 @@ public class DefaultEntitlementService implements EntitlementService {
try {
entitlement = entitlementInternalApi.getEntitlementForId(key.getEntitlementId(), internalCallContext);
} catch (final EntitlementApiException e) {
- log.error("Error retrieving entitlement for id " + key.getEntitlementId(), e);
+ log.error(String.format("Error retrieving entitlementId='%s'", key.getEntitlementId()), e);
return;
}
if (!(entitlement instanceof DefaultEntitlement)) {
- log.error("Entitlement service received an unexpected entitlement class type {}" + entitlement.getClass().getName());
+ log.error(String.format("Error retrieving entitlementId='%s', unexpected entitlement className='%s'", key.getEntitlementId(), entitlement.getClass().getName()));
return;
}
@@ -147,7 +147,7 @@ public class DefaultEntitlementService implements EntitlementService {
entitlementInternalApi.resume(key.getBundleId(), internalCallContext.toLocalDate(key.getEffectiveDate(), ((DefaultEntitlement) entitlement).getSubscriptionBase().getStartDate()), ImmutableList.<PluginProperty>of(), internalCallContext);
}
} catch (final EntitlementApiException e) {
- log.error("Error processing event for entitlement {}" + entitlement.getId(), e);
+ log.error(String.format("Error processing event for entitlementId='%s'", entitlement.getId()), e);
}
}
@@ -190,7 +190,7 @@ public class DefaultEntitlementService implements EntitlementService {
try {
eventBus.post(event);
} catch (final EventBusException e) {
- log.warn("Failed to post event {}", e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
diff --git a/entitlement/src/main/java/org/killbill/billing/entitlement/provider/DefaultEntitlementProviderPluginRegistry.java b/entitlement/src/main/java/org/killbill/billing/entitlement/provider/DefaultEntitlementProviderPluginRegistry.java
index 54b1f19..9f0b11a 100644
--- a/entitlement/src/main/java/org/killbill/billing/entitlement/provider/DefaultEntitlementProviderPluginRegistry.java
+++ b/entitlement/src/main/java/org/killbill/billing/entitlement/provider/DefaultEntitlementProviderPluginRegistry.java
@@ -41,13 +41,13 @@ public class DefaultEntitlementProviderPluginRegistry implements OSGIServiceRegi
@Override
public void registerService(final OSGIServiceDescriptor desc, final EntitlementPluginApi service) {
- log.info("DefaultEntitlementProviderPluginRegistry registering service " + desc.getRegistrationName());
+ log.info("Registering service='{}'", desc.getRegistrationName());
pluginsByName.put(desc.getRegistrationName(), service);
}
@Override
public void unregisterService(final String serviceName) {
- log.info("DefaultEntitlementProviderPluginRegistry unregistering service " + serviceName);
+ log.info("Unregistering service='{}'", serviceName);
pluginsByName.remove(serviceName);
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/api/DefaultInvoiceService.java b/invoice/src/main/java/org/killbill/billing/invoice/api/DefaultInvoiceService.java
index 961d3e7..1c20ed9 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/api/DefaultInvoiceService.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/api/DefaultInvoiceService.java
@@ -56,7 +56,7 @@ public class DefaultInvoiceService implements InvoiceService {
eventBus.register(invoiceListener);
eventBus.register(tagHandler);
} catch (PersistentBus.EventBusException e) {
- throw new RuntimeException("Unable to register to the EventBus!", e);
+ throw new RuntimeException("Failed to register bus handlers", e);
}
dateNotifier.initialize();
}
@@ -72,7 +72,7 @@ public class DefaultInvoiceService implements InvoiceService {
eventBus.unregister(invoiceListener);
eventBus.unregister(tagHandler);
} catch (PersistentBus.EventBusException e) {
- throw new RuntimeException("Unable to unregister to the EventBus!", e);
+ throw new RuntimeException("Failed to unregister bus handlers", e);
}
dateNotifier.stop();
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/api/user/DefaultInvoiceUserApi.java b/invoice/src/main/java/org/killbill/billing/invoice/api/user/DefaultInvoiceUserApi.java
index 7e7406c..f44c153 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/api/user/DefaultInvoiceUserApi.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/api/user/DefaultInvoiceUserApi.java
@@ -456,10 +456,11 @@ public class DefaultInvoiceUserApi implements InvoiceUserApi {
}
private void notifyBusOfInvoiceAdjustment(final UUID invoiceId, final UUID accountId, final InternalCallContext context) {
+ final DefaultInvoiceAdjustmentEvent event = new DefaultInvoiceAdjustmentEvent(invoiceId, accountId, context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
try {
- eventBus.post(new DefaultInvoiceAdjustmentEvent(invoiceId, accountId, context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken()));
+ eventBus.post(event);
} catch (final EventBusException e) {
- log.warn("Failed to post adjustment event for invoice " + invoiceId, e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java b/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java
index 1aa7fd8..c010ce9 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java
@@ -848,7 +848,7 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
eventBus.postFromTransaction(new DefaultInvoiceAdjustmentEvent(invoiceId, accountId, context.getAccountRecordId(), context.getTenantRecordId(), userToken),
entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post adjustment event for invoice " + invoiceId, e);
+ log.warn(String.format("Failed to post adjustment event for invoiceId='%s'", invoiceId), e);
}
}
@@ -887,7 +887,7 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
try {
eventBus.postFromTransaction(busEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post invoice payment event for invoice " + invoicePaymentModelDao.getInvoiceId(), e);
+ log.warn(String.format("Failed to post invoice payment event for invoiceId='%s'", invoicePaymentModelDao.getInvoiceId()), e);
}
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/generator/FixedAndRecurringInvoiceItemGenerator.java b/invoice/src/main/java/org/killbill/billing/invoice/generator/FixedAndRecurringInvoiceItemGenerator.java
index 27e6a43..f024a1b 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/generator/FixedAndRecurringInvoiceItemGenerator.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/generator/FixedAndRecurringInvoiceItemGenerator.java
@@ -103,10 +103,11 @@ public class FixedAndRecurringInvoiceItemGenerator extends InvoiceItemGenerator
}
// Pretty-print the generated invoice items from the junction events
- final StringBuilder logStringBuilder = new StringBuilder("Proposed Invoice items for invoiceId ")
+ final StringBuilder logStringBuilder = new StringBuilder("Proposed Invoice items for invoiceId='")
.append(invoiceId)
- .append(" and accountId ")
- .append(accountId);
+ .append("', accountId='")
+ .append(accountId)
+ .append("'");
final Iterator<BillingEvent> eventIt = events.iterator();
BillingEvent nextEvent = eventIt.next();
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java
index cf7c200..4bbf5e0 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java
@@ -182,7 +182,7 @@ public class InvoiceDispatcher {
try {
eventBus.post(event);
} catch (EventBusException e) {
- log.error("Failed to post event " + event, e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
}
@@ -324,15 +324,15 @@ public class InvoiceDispatcher {
//
if (invoice == null) {
if (isDryRun) {
- log.info("Generated null dryRun invoice for accountId {} and targetDate {} (targetDateTime {})", new Object[]{accountId, targetDate, targetDateTime});
+ log.info("Generated null dryRun invoice for accountId='{}', targetDate='{}', targetDateTime='{}'", accountId, targetDate, targetDateTime);
} else {
- log.info("Generated null invoice for accountId {} and targetDate {} (targetDateTime {})", new Object[]{accountId, targetDate, targetDateTime});
+ log.info("Generated null invoice for accountId='{}', targetDate='{}', targetDateTime='{}'", accountId, targetDate, targetDateTime);
final BusInternalEvent event = new DefaultNullInvoiceEvent(accountId, clock.getUTCToday(),
context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
commitInvoiceAndSetFutureNotifications(account, null, ImmutableList.<InvoiceItemModelDao>of(), futureAccountNotifications, false, context);
- postEvent(event, accountId, context);
+ postEvent(event);
}
return null;
}
@@ -451,10 +451,10 @@ public class InvoiceDispatcher {
private void logInvoiceWithItems(final ImmutableAccountData account, final Invoice invoice, final LocalDate targetDate, final Set<UUID> adjustedUniqueOtherInvoiceId, final boolean isRealInvoiceWithItems) {
final StringBuilder tmp = new StringBuilder();
if (isRealInvoiceWithItems) {
- tmp.append(String.format("Generated invoice %s with %d items for accountId %s and targetDate %s:\n", invoice.getId(), invoice.getNumberOfItems(), account.getId(), targetDate));
+ tmp.append(String.format("Generated invoiceId='%s', numberOfItems='%d', accountId='%s', targetDate='%s':\n", invoice.getId(), invoice.getNumberOfItems(), account.getId(), targetDate));
} else {
final String adjustedInvoices = JOINER_COMMA.join(adjustedUniqueOtherInvoiceId.toArray(new UUID[adjustedUniqueOtherInvoiceId.size()]));
- tmp.append(String.format("Adjusting existing invoices %s with %d items for accountId %s and targetDate %s:\n",
+ tmp.append(String.format("Adjusting existing invoiceId='%s', numberOfItems='%d', accountId='%s', targetDate='%s':\n",
adjustedInvoices, invoice.getNumberOfItems(), account.getId(), targetDate));
}
for (InvoiceItem item : invoice.getInvoiceItems()) {
@@ -499,7 +499,7 @@ public class InvoiceDispatcher {
events.add(event);
}
for (final InvoiceInternalEvent event : events) {
- postEvent(event, account.getId(), context);
+ postEvent(event);
}
}
@@ -554,11 +554,11 @@ public class InvoiceDispatcher {
}
}
- private void postEvent(final BusInternalEvent event, final UUID accountId, final InternalCallContext context) {
+ private void postEvent(final BusInternalEvent event) {
try {
eventBus.post(event);
} catch (final EventBusException e) {
- log.error(String.format("Failed to post event %s for account %s", event.getBusEventType(), accountId), e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceListener.java b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceListener.java
index ca63e2b..51c1e5b 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceListener.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceListener.java
@@ -69,7 +69,7 @@ public class InvoiceListener {
final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "RepairBundle", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken());
dispatcher.processAccount(event.getAccountId(), event.getEffectiveDate(), null, context);
} catch (InvoiceApiException e) {
- log.error(e.getMessage());
+ log.warn(String.format("Unable to process event %s", event), e);
}
}
@@ -88,7 +88,7 @@ public class InvoiceListener {
final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "SubscriptionBaseTransition", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken());
dispatcher.processSubscriptionForInvoiceGeneration(event, context);
} catch (InvoiceApiException e) {
- log.error(e.getMessage());
+ log.warn(String.format("Unable to process event %s", event), e);
}
}
@@ -100,7 +100,7 @@ public class InvoiceListener {
final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "SubscriptionBaseTransition", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken());
dispatcher.processAccount(event.getAccountId(), event.getEffectiveTransitionTime(), null, context);
} catch (InvoiceApiException e) {
- log.error(e.getMessage());
+ log.warn(String.format("Unable to process event %s", event), e);
}
}
@@ -118,9 +118,9 @@ public class InvoiceListener {
final UUID accountId = accountApi.getByRecordId(event.getSearchKey1(), context);
dispatcher.processAccount(accountId, clock.getUTCNow(), null, context);
} catch (InvoiceApiException e) {
- log.error(e.getMessage());
+ log.warn(String.format("Unable to process event %s", event), e);
} catch (AccountApiException e) {
- log.error(e.getMessage());
+ log.warn(String.format("Unable to process event %s", event), e);
}
}
@@ -129,7 +129,7 @@ public class InvoiceListener {
final InternalCallContext context = internalCallContextFactory.createInternalCallContext(tenantRecordId, accountRecordId, "Next Billing Date", CallOrigin.INTERNAL, UserType.SYSTEM, userToken);
dispatcher.processSubscriptionForInvoiceGeneration(subscriptionId, eventDateTime, context);
} catch (InvoiceApiException e) {
- log.error(e.getMessage());
+ log.warn(String.format("Unable to process subscriptionId='%s', eventDateTime='%s", subscriptionId, eventDateTime), e);
}
}
@@ -138,7 +138,7 @@ public class InvoiceListener {
final InternalCallContext context = internalCallContextFactory.createInternalCallContext(tenantRecordId, accountRecordId, "Next Billing Date", CallOrigin.INTERNAL, UserType.SYSTEM, userToken);
dispatcher.processSubscriptionForInvoiceNotification(subscriptionId, eventDateTime, context);
} catch (InvoiceApiException e) {
- log.error(e.getMessage());
+ log.warn(String.format("Unable to process subscriptionId='%s', eventDateTime='%s", subscriptionId, eventDateTime), e);
}
}
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceTagHandler.java b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceTagHandler.java
index cb6ed8c..12472ac 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceTagHandler.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceTagHandler.java
@@ -67,7 +67,7 @@ public class InvoiceTagHandler {
try {
dispatcher.processAccount(accountId, clock.getUTCNow(), null, context);
} catch (InvoiceApiException e) {
- log.warn(String.format("Failed to process process removal AUTO_INVOICING_OFF for account %s", accountId), e);
+ log.warn(String.format("Failed to process tag removal AUTO_INVOICING_OFF for accountId='%s'", accountId), e);
}
}
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/notification/DefaultNextBillingDateNotifier.java b/invoice/src/main/java/org/killbill/billing/invoice/notification/DefaultNextBillingDateNotifier.java
index e5ec2ae..93494b6 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/notification/DefaultNextBillingDateNotifier.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/notification/DefaultNextBillingDateNotifier.java
@@ -70,33 +70,29 @@ public class DefaultNextBillingDateNotifier implements NextBillingDateNotifier {
final NotificationQueueHandler notificationQueueHandler = new NotificationQueueHandler() {
@Override
public void handleReadyNotification(final NotificationEvent notificationKey, final DateTime eventDate, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) {
+ if (!(notificationKey instanceof NextBillingDateNotificationKey)) {
+ log.error("Invoice service received an unexpected event className='{}", notificationKey.getClass());
+ return;
+ }
+
+ final NextBillingDateNotificationKey key = (NextBillingDateNotificationKey) notificationKey;
+
+ // Just to ensure compatibility with json that might not have that targetDate field (old versions < 0.13.6)
+ final DateTime targetDate = key.getTargetDate() != null ? key.getTargetDate() : eventDate;
try {
- if (!(notificationKey instanceof NextBillingDateNotificationKey)) {
- log.error("Invoice service received an unexpected event type {}", notificationKey.getClass().getName());
+ final SubscriptionBase subscription = subscriptionApi.getSubscriptionFromId(key.getUuidKey(), callContextFactory.createInternalTenantContext(tenantRecordId, accountRecordId));
+ if (subscription == null) {
+ log.warn("Unable to retrieve subscriptionId='{}' for event {}", key.getUuidKey(), key);
return;
}
-
- final NextBillingDateNotificationKey key = (NextBillingDateNotificationKey) notificationKey;
-
- // Just to ensure compatibility with json that might not have that targetDate field (old versions < 0.13.6)
- final DateTime targetDate = key.getTargetDate() != null ? key.getTargetDate() : eventDate;
- try {
- final SubscriptionBase subscription = subscriptionApi.getSubscriptionFromId(key.getUuidKey(), callContextFactory.createInternalTenantContext(tenantRecordId, accountRecordId));
- if (subscription == null) {
- log.warn("Next Billing Date Notification Queue handled spurious notification (key: " + key + ")");
- return;
- }
- if (key.isDryRunForInvoiceNotification() != null && // Just to ensure compatibility with json that might not have that field (old versions < 0.13.6)
- key.isDryRunForInvoiceNotification()) {
- processEventForInvoiceNotification(key.getUuidKey(), targetDate, userToken, accountRecordId, tenantRecordId);
- } else {
- processEventForInvoiceGeneration(key.getUuidKey(), targetDate, userToken, accountRecordId, tenantRecordId);
- }
- } catch (SubscriptionBaseApiException e) {
- log.warn("Next Billing Date Notification Queue handled spurious notification (key: " + key + ")", e);
+ if (key.isDryRunForInvoiceNotification() != null && // Just to ensure compatibility with json that might not have that field (old versions < 0.13.6)
+ key.isDryRunForInvoiceNotification()) {
+ processEventForInvoiceNotification(key.getUuidKey(), targetDate, userToken, accountRecordId, tenantRecordId);
+ } else {
+ processEventForInvoiceGeneration(key.getUuidKey(), targetDate, userToken, accountRecordId, tenantRecordId);
}
- } catch (IllegalArgumentException e) {
- log.error("The key returned from the NextBillingNotificationQueue is not a valid UUID", e);
+ } catch (SubscriptionBaseApiException e) {
+ log.error(String.format("Error retrieving subscriptionId='%s'", key.getUuidKey()), e);
}
}
};
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/provider/DefaultInvoiceProviderPluginRegistry.java b/invoice/src/main/java/org/killbill/billing/invoice/provider/DefaultInvoiceProviderPluginRegistry.java
index 404b9fc..1860257 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/provider/DefaultInvoiceProviderPluginRegistry.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/provider/DefaultInvoiceProviderPluginRegistry.java
@@ -41,13 +41,13 @@ public class DefaultInvoiceProviderPluginRegistry implements OSGIServiceRegistra
@Override
public void registerService(final OSGIServiceDescriptor desc, final InvoicePluginApi service) {
- log.info("DefaultInvoiceProviderPluginRegistry registering service " + desc.getRegistrationName());
+ log.info("Registering service='{}'", desc.getRegistrationName());
pluginsByName.put(desc.getRegistrationName(), service);
}
@Override
public void unregisterService(final String serviceName) {
- log.info("DefaultInvoiceProviderPluginRegistry unregistering service " + serviceName);
+ log.info("Unregistering service='{}'", serviceName);
pluginsByName.remove(serviceName);
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceFormatter.java b/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceFormatter.java
index 7ebb8d2..abf6119 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceFormatter.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceFormatter.java
@@ -284,10 +284,10 @@ public class DefaultInvoiceFormatter implements InvoiceFormatter {
}
}
} catch (final CurrencyConversionException e) {
- logger.warn("Failed to retrieve currency conversion rates for currency = " + currency + " and date = " + latestPaymentDate, e);
+ logger.warn(String.format("Failed to retrieve currency conversion rates for currency='%s', dateConversion='%s'", currency, latestPaymentDate), e);
return null;
}
- logger.warn("Failed to retrieve currency conversion rates for currency = " + currency + " and date = " + latestPaymentDate);
+ logger.warn("Failed to retrieve currency conversion rates for currency='{}', dateConversion='{}'", currency, latestPaymentDate);
return null;
}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/usage/RawUsageOptimizer.java b/invoice/src/main/java/org/killbill/billing/invoice/usage/RawUsageOptimizer.java
index afdc98d..b78fcbc 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/usage/RawUsageOptimizer.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/usage/RawUsageOptimizer.java
@@ -67,8 +67,8 @@ public class RawUsageOptimizer {
public RawUsageOptimizerResult getConsumableInArrearUsage(final LocalDate firstEventStartDate, final LocalDate targetDate, final Iterable<InvoiceItem> existingUsageItems, final Map<String, Usage> knownUsage, final InternalCallContext internalCallContext) {
final LocalDate targetStartDate = config.getMaxRawUsagePreviousPeriod() > 0 ? getOptimizedRawUsageStartDate(firstEventStartDate, targetDate, existingUsageItems, knownUsage) : firstEventStartDate;
- log.info("RawUsageOptimizer [accountRecordId = {}]: rawUsageStartDate = {}, (proposed) firstEventStartDate = {}",
- new Object[]{internalCallContext.getAccountRecordId(), targetStartDate, firstEventStartDate});
+ log.info("ConsumableInArrear accountRecordId='{}', rawUsageStartDate='{}', firstEventStartDate='{}'",
+ internalCallContext.getAccountRecordId(), targetStartDate, firstEventStartDate);
final List<RawUsage> rawUsageData = usageApi.getRawUsageForAccount(targetStartDate, targetDate, internalCallContext);
return new RawUsageOptimizerResult(firstEventStartDate, targetStartDate, rawUsageData);
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/PaymentMethodResource.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/PaymentMethodResource.java
index 07fdd5e..9a601ae 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/PaymentMethodResource.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/PaymentMethodResource.java
@@ -179,7 +179,7 @@ public class PaymentMethodResource extends JaxRsResourceBase {
account = accountUserApi.getAccountById(paymentMethod.getAccountId(), tenantContext);
accounts.put(paymentMethod.getAccountId(), account);
} catch (final AccountApiException e) {
- log.warn("Unable to retrieve account", e);
+ log.warn(String.format("Error retrieving accountId='%s'", paymentMethod.getAccountId()), e);
return null;
}
}
@@ -238,7 +238,7 @@ public class PaymentMethodResource extends JaxRsResourceBase {
account = accountUserApi.getAccountById(paymentMethod.getAccountId(), tenantContext);
accounts.put(paymentMethod.getAccountId(), account);
} catch (final AccountApiException e) {
- log.warn("Unable to retrieve account", e);
+ log.warn(String.format("Error retrieving accountId='%s'", paymentMethod.getAccountId()), e);
return null;
}
}
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java
index 7749b79..0e939ba 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java
@@ -515,20 +515,20 @@ public class SubscriptionResource extends JaxRsResourceBase {
@Override
public void onSubscriptionBaseTransition(final EffectiveSubscriptionInternalEvent event) {
- log.info(String.format("Got event SubscriptionBaseTransition token = %s, type = %s, remaining = %d ",
+ log.info(String.format("Got event SubscriptionBaseTransition token='%s', type='%s', remaining='%d'",
event.getUserToken(), event.getTransitionType(), event.getRemainingEventsForUserOperation()));
}
@Override
public void onEmptyInvoice(final NullInvoiceInternalEvent event) {
- log.info(String.format("Got event EmptyInvoiceNotification token = %s ", event.getUserToken()));
+ log.info(String.format("Got event EmptyInvoiceNotification token='%s'", event.getUserToken()));
notifyForCompletion();
}
@Override
public void onInvoiceCreation(final InvoiceCreationInternalEvent event) {
- log.info(String.format("Got event InvoiceCreationNotification token = %s ", event.getUserToken()));
+ log.info(String.format("Got event InvoiceCreationNotification token='%s'", event.getUserToken()));
if (event.getAmountOwed().compareTo(BigDecimal.ZERO) <= 0) {
notifyForCompletion();
}
@@ -536,19 +536,19 @@ public class SubscriptionResource extends JaxRsResourceBase {
@Override
public void onPaymentInfo(final PaymentInfoInternalEvent event) {
- log.info(String.format("Got event PaymentInfo token = %s ", event.getUserToken()));
+ log.info(String.format("Got event PaymentInfo token='%s'", event.getUserToken()));
notifyForCompletion();
}
@Override
public void onPaymentError(final PaymentErrorInternalEvent event) {
- log.info(String.format("Got event PaymentError token = %s ", event.getUserToken()));
+ log.info(String.format("Got event PaymentError token='%s'", event.getUserToken()));
notifyForCompletion();
}
@Override
public void onPaymentPluginError(final PaymentPluginErrorInternalEvent event) {
- log.info(String.format("Got event PaymentPluginError token = %s ", event.getUserToken()));
+ log.info(String.format("Got event PaymentPluginError token='%s'", event.getUserToken()));
notifyForCompletion();
}
}
diff --git a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java
index 84b3bc1..733f876 100644
--- a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java
+++ b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java
@@ -144,7 +144,7 @@ public class BillCycleDayCalculator {
final DateTime date = plan.dateOfFirstRecurringNonZeroCharge(subscription.getStartDate(), initialPhaseType);
final int bcdLocal = context.toDateTime(date, account.getTimeZone()).getDayOfMonth();
- log.info("Calculated BCD: subscription id {}, subscription start {}, timezone {}, bcd {}",
+ log.info("Calculated BCD: subscriptionId='{}', subscriptionStartDate='{}', accountTimeZone='{}', bcd='{}'",
subscription.getId(), date.toDateTimeISO(), account.getTimeZone(), bcdLocal);
return bcdLocal;
diff --git a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
index 359975f..f263960 100644
--- a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
+++ b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
@@ -110,7 +110,7 @@ public class DefaultInternalBillingApi implements BillingInternalApi {
}
// Pretty-print the events, before and after the blocking calculator does its magic
- final StringBuilder logStringBuilder = new StringBuilder("Computed billing events for accountId ").append(accountId);
+ final StringBuilder logStringBuilder = new StringBuilder("Computed billing events for accountId='").append(accountId).append("'");
eventsToString(logStringBuilder, result, "\nBilling Events Raw");
blockCalculator.insertBlockingEvents(result, skippedSubscriptions, context);
eventsToString(logStringBuilder, result, "\nBilling Events After Blocking");
diff --git a/overdue/src/main/java/org/killbill/billing/overdue/applicator/OverdueStateApplicator.java b/overdue/src/main/java/org/killbill/billing/overdue/applicator/OverdueStateApplicator.java
index 91a0e03..e1c5db4 100644
--- a/overdue/src/main/java/org/killbill/billing/overdue/applicator/OverdueStateApplicator.java
+++ b/overdue/src/main/java/org/killbill/billing/overdue/applicator/OverdueStateApplicator.java
@@ -27,7 +27,6 @@ import java.util.UUID;
import javax.inject.Named;
import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
import org.joda.time.Period;
import org.killbill.billing.ErrorCode;
import org.killbill.billing.ObjectType;
@@ -171,11 +170,20 @@ public class OverdueStateApplicator {
} catch (final AccountApiException e) {
throw new OverdueException(e);
}
+
+ final OverdueChangeInternalEvent event;
+ try {
+ event = createOverdueEvent(account, previousOverdueState.getName(), nextOverdueState.getName(), isBlockBillingTransition(previousOverdueState, nextOverdueState),
+ isUnblockBillingTransition(previousOverdueState, nextOverdueState), context);
+ } catch (final BlockingApiException e) {
+ log.warn(String.format("Failed to create OverdueChangeInternalEvent for accountId='%s'", account.getId()), e);
+ return;
+ }
+
try {
- bus.post(createOverdueEvent(account, previousOverdueState.getName(), nextOverdueState.getName(), isBlockBillingTransition(previousOverdueState, nextOverdueState),
- isUnblockBillingTransition(previousOverdueState, nextOverdueState), context));
+ bus.post(event);
} catch (final Exception e) {
- log.error("Error posting overdue change event to bus", e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
@@ -218,11 +226,19 @@ public class OverdueStateApplicator {
throw new OverdueException(e);
}
+ final OverdueChangeInternalEvent event;
+ try {
+ event = createOverdueEvent(account, previousOverdueState.getName(), clearState.getName(), isBlockBillingTransition(previousOverdueState, clearState),
+ isUnblockBillingTransition(previousOverdueState, clearState), context);
+ } catch (final BlockingApiException e) {
+ log.warn(String.format("Failed to create OverdueChangeInternalEvent for accountId='%s'", account.getId()), e);
+ return;
+ }
+
try {
- bus.post(createOverdueEvent(account, previousOverdueState.getName(), clearState.getName(), isBlockBillingTransition(previousOverdueState, clearState),
- isUnblockBillingTransition(previousOverdueState, clearState), context));
+ bus.post(event);
} catch (final Exception e) {
- log.error("Error posting overdue change event to bus", e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
@@ -372,11 +388,11 @@ public class OverdueStateApplicator {
emailSender.sendPlainTextEmail(to, cc, subject, emailBody);
}
} catch (final IOException e) {
- log.warn(String.format("Unable to generate or send overdue notification email for account %s and overdueable %s", account.getId(), account.getId()), e);
+ log.warn(String.format("Unable to generate or send overdue notification email for accountId='%s'", account.getId()), e);
} catch (final EmailApiException e) {
- log.warn(String.format("Unable to send overdue notification email for account %s and overdueable %s", account.getId(), account.getId()), e);
+ log.warn(String.format("Unable to send overdue notification email for accountId='%s'", account.getId()), e);
} catch (final MustacheException e) {
- log.warn(String.format("Unable to generate overdue notification email for account %s and overdueable %s", account.getId(), account.getId()), e);
+ log.warn(String.format("Unable to generate overdue notification email for accountId='%s'", account.getId()), e);
}
}
diff --git a/overdue/src/main/java/org/killbill/billing/overdue/caching/EhCacheOverdueConfigCache.java b/overdue/src/main/java/org/killbill/billing/overdue/caching/EhCacheOverdueConfigCache.java
index d52470c..7285e87 100644
--- a/overdue/src/main/java/org/killbill/billing/overdue/caching/EhCacheOverdueConfigCache.java
+++ b/overdue/src/main/java/org/killbill/billing/overdue/caching/EhCacheOverdueConfigCache.java
@@ -60,7 +60,7 @@ public class EhCacheOverdueConfigCache implements OverdueConfigCache {
defaultOverdueConfig = XMLLoader.getObjectFromUri(noOverdueConfigURI, DefaultOverdueConfig.class);
} catch (final Exception e) {
defaultOverdueConfig = new DefaultOverdueConfig();
- log.warn("Exception loading NoOverdueConfig - should never happen!", e);
+ log.error("Exception loading NoOverdueConfig - should never happen!", e);
}
}
diff --git a/overdue/src/main/java/org/killbill/billing/overdue/caching/OverdueCacheInvalidationCallback.java b/overdue/src/main/java/org/killbill/billing/overdue/caching/OverdueCacheInvalidationCallback.java
index e7fb85e..4a19678 100644
--- a/overdue/src/main/java/org/killbill/billing/overdue/caching/OverdueCacheInvalidationCallback.java
+++ b/overdue/src/main/java/org/killbill/billing/overdue/caching/OverdueCacheInvalidationCallback.java
@@ -38,7 +38,7 @@ public class OverdueCacheInvalidationCallback implements CacheInvalidationCallba
@Override
public void invalidateCache(TenantKey key, final Object cookie, final InternalTenantContext tenantContext) {
- log.info("Invalidate overdue cache for tenant {} ", tenantContext.getTenantRecordId());
+ log.info("Invalidate overdue cache for tenantRecordId='{}'", tenantContext.getTenantRecordId());
overdueConfigCache.clearOverdueConfig(tenantContext);
}
}
diff --git a/overdue/src/main/java/org/killbill/billing/overdue/service/DefaultOverdueService.java b/overdue/src/main/java/org/killbill/billing/overdue/service/DefaultOverdueService.java
index 87cc174..087eb5f 100644
--- a/overdue/src/main/java/org/killbill/billing/overdue/service/DefaultOverdueService.java
+++ b/overdue/src/main/java/org/killbill/billing/overdue/service/DefaultOverdueService.java
@@ -91,8 +91,7 @@ public class DefaultOverdueService implements OverdueService {
overdueConfigCache.loadDefaultOverdueConfig(properties.getConfigURI());
isConfigLoaded = true;
} catch (OverdueApiException e) {
- log.warn("Overdue system disabled: unable to loadDefaultCatalog the overdue config from " + properties.getConfigURI(), e);
- e.printStackTrace();
+ log.warn(String.format("Overdue system disabled: unable to load the overdue config from uri='%s'", properties.getConfigURI()), e);
}
}
}
@@ -109,7 +108,7 @@ public class DefaultOverdueService implements OverdueService {
try {
busService.getBus().register(listener);
} catch (final EventBusException e) {
- log.error("Problem encountered registering OverdueListener on the Event Bus", e);
+ log.error("Failed to register OverdueListener", e);
}
}
@@ -124,7 +123,7 @@ public class DefaultOverdueService implements OverdueService {
try {
busService.getBus().unregister(listener);
} catch (final EventBusException e) {
- log.error("Problem encountered registering OverdueListener on the Event Bus", e);
+ log.error("Failed to unregister OverdueListener", e);
}
checkNotifier.stop();
asyncNotifier.stop();
diff --git a/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java b/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java
index c7705ec..45f8ba0 100644
--- a/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java
+++ b/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java
@@ -80,8 +80,7 @@ public class PaymentBusEventHandler {
@AllowConcurrentEvents
@Subscribe
public void processInvoiceEvent(final InvoiceCreationInternalEvent event) {
- log.info("Received invoice creation notification for account {} and invoice {}",
- event.getAccountId(), event.getInvoiceId());
+ log.info("Received invoice creation notification for accountId='{}', invoiceId='{}'", event.getAccountId(), event.getInvoiceId());
final Account account;
try {
@@ -100,7 +99,7 @@ public class PaymentBusEventHandler {
pluginControlPaymentProcessor.createPurchase(false, account, account.getPaymentMethodId(), null, amountToBePaid, account.getCurrency(), UUIDs.randomUUID().toString(), UUIDs.randomUUID().toString(),
properties, paymentControlPluginNames, callContext, internalContext);
} catch (final AccountApiException e) {
- log.error("Failed to process invoice payment", e);
+ log.warn("Failed to process invoice payment", e);
} catch (final PaymentApiException e) {
// Log as error unless:
if (e.getCode() != ErrorCode.PAYMENT_NULL_INVOICE.getCode() /* Nothing left to be paid */ &&
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java b/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java
index 4803871..5f3e8b4 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java
@@ -125,9 +125,9 @@ abstract class CompletionTaskBase<T> implements Runnable {
lock = locker.lockWithNumberOfTries(LockerType.ACCNT_INV_PAY.toString(), account.getExternalKey(), paymentConfig.getMaxGlobalLockRetries());
return callback.doIteration();
} catch (AccountApiException e) {
- log.warn(String.format("Janitor failed to retrieve account with recordId %s", internalTenantContext.getAccountRecordId()), e);
+ log.warn(String.format("Error retrieving accountRecordId='%s'", internalTenantContext.getAccountRecordId()), e);
} catch (LockFailedException e) {
- log.warn(String.format("Janitor failed to lock account with recordId %s", internalTenantContext.getAccountRecordId()), e);
+ log.warn(String.format("Error locking accountRecordId='%s'", internalTenantContext.getAccountRecordId()), e);
} finally {
if (lock != null) {
lock.release();
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentAttemptTask.java b/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentAttemptTask.java
index 9851afb..183e779 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentAttemptTask.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentAttemptTask.java
@@ -124,7 +124,7 @@ public class IncompletePaymentAttemptTask extends CompletionTaskBase<PaymentAtte
if (transaction == null ||
transaction.getTransactionStatus() == TransactionStatus.PLUGIN_FAILURE ||
transaction.getTransactionStatus() == TransactionStatus.PAYMENT_FAILURE) {
- log.info("Janitor AttemptCompletionTask moving attempt " + attempt.getId() + " -> ABORTED");
+ log.info("Moving attemptId='{}' to ABORTED", attempt.getId());
paymentDao.updatePaymentAttempt(attempt.getId(), attempt.getTransactionId(), "ABORTED", internalCallContext);
return;
}
@@ -140,7 +140,7 @@ public class IncompletePaymentAttemptTask extends CompletionTaskBase<PaymentAtte
transaction.getTransactionStatus() == TransactionStatus.PENDING) {
try {
- log.info("Janitor AttemptCompletionTask completing attempt " + attempt.getId() + " -> SUCCESS");
+ log.info("Moving attemptId='{}' to SUCCESS", attempt.getId());
final Account account = accountInternalApi.getAccountById(attempt.getAccountId(), tenantContext);
final boolean isApiPayment = true; // unclear
@@ -166,11 +166,11 @@ public class IncompletePaymentAttemptTask extends CompletionTaskBase<PaymentAtte
//
pluginControlledPaymentAutomatonRunner.completeRun(paymentStateContext);
} catch (final AccountApiException e) {
- log.warn("Janitor AttemptCompletionTask failed to complete payment attempt " + attempt.getId(), e);
+ log.warn(String.format("Error completing paymentAttemptId='%s'", attempt.getId()), e);
} catch (final PluginPropertySerializerException e) {
- log.warn("Janitor AttemptCompletionTask failed to complete payment attempt " + attempt.getId(), e);
+ log.warn(String.format("Error completing paymentAttemptId='%s'", attempt.getId()), e);
} catch (final PaymentApiException e) {
- log.warn("Janitor AttemptCompletionTask failed to complete payment attempt " + attempt.getId(), e);
+ log.warn(String.format("Error completing paymentAttemptId='%s'", attempt.getId()), e);
}
}
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentTransactionTask.java b/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentTransactionTask.java
index c71407d..3be1735 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentTransactionTask.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/janitor/IncompletePaymentTransactionTask.java
@@ -192,7 +192,7 @@ public class IncompletePaymentTransactionTask extends CompletionTaskBase<Payment
case UNKNOWN:
default:
if (transactionStatus != paymentTransaction.getTransactionStatus()) {
- log.info("Janitor IncompletePaymentTransactionTask unable to repair payment {}, transaction {}: {} -> {}",
+ log.info("Unable to repair paymentId='{}', paymentTransactionId='{}', currentTransactionStatus='{}', newTransactionStatus='{}'",
payment.getId(), paymentTransaction.getId(), paymentTransaction.getTransactionStatus(), transactionStatus);
}
// We can't get anything interesting from the plugin...
@@ -233,8 +233,7 @@ public class IncompletePaymentTransactionTask extends CompletionTaskBase<Payment
final String gatewayErrorCode = paymentTransactionInfoPlugin != null ? paymentTransactionInfoPlugin.getGatewayErrorCode() : paymentTransaction.getGatewayErrorCode();
final String gatewayError = paymentTransactionInfoPlugin != null ? paymentTransactionInfoPlugin.getGatewayError() : paymentTransaction.getGatewayErrorMsg();
-
- log.info("Janitor IncompletePaymentTransactionTask repairing payment {}, transaction {}, transitioning transactionStatus from {} -> {}",
+ log.info("Repairing paymentId='{}', paymentTransactionId='{}', currentTransactionStatus='{}', newTransactionStatus='{}'",
payment.getId(), paymentTransaction.getId(), paymentTransaction.getTransactionStatus(), transactionStatus);
final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(payment.getAccountId(), callContext);
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/janitor/Janitor.java b/payment/src/main/java/org/killbill/billing/payment/core/janitor/Janitor.java
index fbac8e0..c17f17c 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/janitor/Janitor.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/janitor/Janitor.java
@@ -135,7 +135,7 @@ public class Janitor {
@Override
public void handleReadyNotification(final NotificationEvent notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) {
if (!(notificationKey instanceof JanitorNotificationKey)) {
- log.error("Janitor service received an unexpected event type {}" + notificationKey.getClass().getName());
+ log.error("Janitor service received an unexpected event className='{}", notificationKey.getClass());
return;
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/PaymentMethodProcessor.java b/payment/src/main/java/org/killbill/billing/payment/core/PaymentMethodProcessor.java
index 4ab1a19..0ad8e57 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/PaymentMethodProcessor.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/PaymentMethodProcessor.java
@@ -139,7 +139,7 @@ public class PaymentMethodProcessor extends ProcessorBase {
accountInternalApi.updatePaymentMethod(account.getId(), pm.getId(), context);
}
} catch (final PaymentPluginApiException e) {
- log.warn("Error adding payment method " + pm.getId() + " for plugin " + paymentPluginServiceName, e);
+ log.warn(String.format("Error adding paymentMethodId='%s', plugin='%s'", pm.getId(), paymentPluginServiceName), e);
throw new PaymentApiException(ErrorCode.PAYMENT_ADD_PAYMENT_METHOD, account.getId(), e.getErrorMessage());
} catch (final AccountApiException e) {
throw new PaymentApiException(e);
@@ -176,7 +176,7 @@ public class PaymentMethodProcessor extends ProcessorBase {
try {
paymentMethodPlugin = pluginApi.getPaymentMethodDetail(account.getId(), pm.getId(), properties, callContext);
} catch (final PaymentPluginApiException e) {
- log.warn("Error retrieving payment method " + pm.getId() + " from plugin " + pm.getPluginName(), e);
+ log.warn(String.format("Error retrieving paymentMethodId='%s', plugin='%s'", pm.getId(), pm.getPluginName()), e);
return null;
}
@@ -227,7 +227,7 @@ public class PaymentMethodProcessor extends ProcessorBase {
final PaymentPluginApi pluginApi = getPaymentPluginApi(paymentMethodModelDao.getPluginName());
paymentMethodPlugin = pluginApi.getPaymentMethodDetail(paymentMethodModelDao.getAccountId(), paymentMethodModelDao.getId(), properties, tenantContext);
} catch (final PaymentPluginApiException e) {
- log.warn("Error retrieving payment method " + paymentMethodModelDao.getId() + " from plugin " + paymentMethodModelDao.getPluginName(), e);
+ log.warn(String.format("Error retrieving paymentMethodId='%s', plugin='%s'", paymentMethodModelDao.getId(), paymentMethodModelDao.getPluginName()), e);
throw new PaymentApiException(ErrorCode.PAYMENT_GET_PAYMENT_METHODS, paymentMethodModelDao.getAccountId(), paymentMethodModelDao.getId());
}
} else {
@@ -413,7 +413,7 @@ public class PaymentMethodProcessor extends ProcessorBase {
} else {
final boolean isAccountAutoPayOff = isAccountAutoPayOff(account.getId(), context);
if (!isAccountAutoPayOff) {
- log.info("Setting account {} to AUTO_PAY_OFF because of default payment method deletion", account.getId());
+ log.info("Setting AUTO_PAY_OFF on accountId='{}' because of default payment method deletion", account.getId());
setAccountAutoPayOff(account.getId(), context);
}
accountInternalApi.removePaymentMethod(account.getId(), context);
@@ -424,7 +424,7 @@ public class PaymentMethodProcessor extends ProcessorBase {
paymentDao.deletedPaymentMethod(paymentMethodId, context);
return PluginDispatcher.createPluginDispatcherReturnType(null);
} catch (final PaymentPluginApiException e) {
- log.warn("Error deleting payment method " + paymentMethodId, e);
+ log.warn(String.format("Error deleting paymentMethodId='%s'", paymentMethodId), e);
throw new PaymentApiException(ErrorCode.PAYMENT_DEL_PAYMENT_METHOD, account.getId(), e.getErrorMessage());
} catch (final AccountApiException e) {
throw new PaymentApiException(e);
@@ -502,7 +502,7 @@ public class PaymentMethodProcessor extends ProcessorBase {
return ImmutableList.<PaymentMethod>of();
}
} catch (final PaymentPluginApiException e) {
- log.warn("Error refreshing payment methods for account " + account.getId() + " and plugin " + pluginName, e);
+ log.warn(String.format("Error refreshing payment methods for accountId='%s', plugin='%s'", account.getId(), pluginName), e);
throw new PaymentApiException(ErrorCode.PAYMENT_REFRESH_PAYMENT_METHOD, account.getId(), e.getErrorMessage());
}
@@ -541,7 +541,7 @@ public class PaymentMethodProcessor extends ProcessorBase {
try {
pluginApi.resetPaymentMethods(account.getId(), pluginPmsWithId, properties, callContext);
} catch (final PaymentPluginApiException e) {
- log.warn("Error resetting payment methods for account " + account.getId() + " and plugin " + pluginName, e);
+ log.warn(String.format("Error resetting payment methods for accountId='%s', plugin='%s'", account.getId(), pluginName), e);
throw new PaymentApiException(ErrorCode.PAYMENT_REFRESH_PAYMENT_METHOD, account.getId(), e.getErrorMessage());
}
try {
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/PluginControlPaymentProcessor.java b/payment/src/main/java/org/killbill/billing/payment/core/PluginControlPaymentProcessor.java
index 85ba858..624907f 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/PluginControlPaymentProcessor.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/PluginControlPaymentProcessor.java
@@ -225,20 +225,20 @@ public class PluginControlPaymentProcessor extends ProcessorBase {
internalCallContext);
} catch (final AccountApiException e) {
- log.warn("Failed to retry attempt " + attemptId + toPluginNamesOnError(" for plugins ", paymentControlPluginNames), e);
+ log.warn(String.format("Failed to retry attemptId='%s', paymentControlPlugins='%s'", attemptId, toPluginNamesOnError(paymentControlPluginNames)), e);
} catch (final PaymentApiException e) {
- log.warn("Failed to retry attempt " + attemptId + toPluginNamesOnError(" for plugins ", paymentControlPluginNames), e);
+ log.warn(String.format("Failed to retry attemptId='%s', paymentControlPlugins='%s'", attemptId, toPluginNamesOnError(paymentControlPluginNames)), e);
} catch (final PluginPropertySerializerException e) {
- log.warn("Failed to retry attempt " + attemptId + toPluginNamesOnError(" for plugins ", paymentControlPluginNames), e);
+ log.warn(String.format("Failed to retry attemptId='%s', paymentControlPlugins='%s'", attemptId, toPluginNamesOnError(paymentControlPluginNames)), e);
} catch (final MissingEntryException e) {
- log.warn("Failed to retry attempt " + attemptId + toPluginNamesOnError(" for plugins ", paymentControlPluginNames), e);
+ log.warn(String.format("Failed to retry attemptId='%s', paymentControlPlugins='%s'", attemptId, toPluginNamesOnError(paymentControlPluginNames)), e);
}
}
- private String toPluginNamesOnError(final String prefixMessage, final Collection<String> paymentControlPluginNames) {
+ private String toPluginNamesOnError(final Collection<String> paymentControlPluginNames) {
if (paymentControlPluginNames == null || paymentControlPluginNames.isEmpty()) {
return "";
}
- return prefixMessage + "(" + JOINER.join(paymentControlPluginNames) + ")";
+ return JOINER.join(paymentControlPluginNames);
}
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/sm/control/ControlPluginRunner.java b/payment/src/main/java/org/killbill/billing/payment/core/sm/control/ControlPluginRunner.java
index 7d4e20b..be558eb 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/sm/control/ControlPluginRunner.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/sm/control/ControlPluginRunner.java
@@ -187,9 +187,9 @@ public class ControlPluginRunner {
}
// Exceptions from the control plugins are ignored (and logged) because the semantics on what to do are undefined.
} catch (final PaymentControlApiException e) {
- log.warn("Plugin " + pluginName + " failed to complete executePluginOnSuccessCalls call for " + inputPaymentControlContext.getPaymentExternalKey(), e);
+ log.warn(String.format("Error during onSuccessCall for plugin='%s', paymentExternalKey='%s'", pluginName, inputPaymentControlContext.getPaymentExternalKey()), e);
} catch (final RuntimeException e) {
- log.warn("Plugin " + pluginName + " failed to complete executePluginOnSuccessCalls call for " + inputPaymentControlContext.getPaymentExternalKey(), e);
+ log.warn(String.format("Error during onSuccessCall for plugin='%s', paymentExternalKey='%s'", pluginName, inputPaymentControlContext.getPaymentExternalKey()), e);
}
}
}
@@ -247,7 +247,7 @@ public class ControlPluginRunner {
}
} catch (final PaymentControlApiException e) {
- log.warn("Plugin " + pluginName + " failed to return next retryDate for payment " + inputPaymentControlContext.getPaymentExternalKey(), e);
+ log.warn(String.format("Error during onFailureCall for plugin='%s', paymentExternalKey='%s'", pluginName, inputPaymentControlContext.getPaymentExternalKey()), e);
return new DefaultFailureCallResult(candidate, inputPluginProperties);
}
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/sm/control/OperationControlCallback.java b/payment/src/main/java/org/killbill/billing/payment/core/sm/control/OperationControlCallback.java
index a463954..614e9df 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/sm/control/OperationControlCallback.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/sm/control/OperationControlCallback.java
@@ -165,14 +165,13 @@ public abstract class OperationControlCallback extends OperationCallbackBase<Pay
if (originalExceptionOrCause instanceof OperationException) {
return (OperationException) originalExceptionOrCause;
} else if (originalExceptionOrCause instanceof LockFailedException) {
- final String format = String.format("Failed to lock account %s", paymentStateContext.getAccount().getExternalKey());
- logger.error(String.format(format));
+ logger.warn(String.format("Failed to lock accountId='%s'", paymentStateContext.getAccount().getId()));
} else if (originalExceptionOrCause instanceof TimeoutException) {
- logger.warn("RetryOperationCallback call TIMEOUT for account {}", paymentStateContext.getAccount().getExternalKey());
+ logger.warn("Call TIMEOUT for accountId='{}'", paymentStateContext.getAccount().getId());
} else if (originalExceptionOrCause instanceof InterruptedException) {
- logger.error("RetryOperationCallback call was interrupted for account {}", paymentStateContext.getAccount().getExternalKey());
+ logger.warn("Call was interrupted for accountId='{}'", paymentStateContext.getAccount().getId());
} else /* most probably RuntimeException */ {
- logger.warn("RetryOperationCallback failed for account {}", paymentStateContext.getAccount().getExternalKey(), e);
+ logger.warn("Operation failed for accountId='{}'", paymentStateContext.getAccount().getId(), e);
}
return new OperationException(e, getOperationResultOnException(paymentStateContext));
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/sm/payments/PaymentEnteringStateCallback.java b/payment/src/main/java/org/killbill/billing/payment/core/sm/payments/PaymentEnteringStateCallback.java
index f5dd2f2..9a487d5 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/sm/payments/PaymentEnteringStateCallback.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/sm/payments/PaymentEnteringStateCallback.java
@@ -76,7 +76,7 @@ public abstract class PaymentEnteringStateCallback implements EnteringStateCallb
try {
daoHelper.getEventBus().post(event);
} catch (EventBusException e) {
- logger.error("Failed to post Payment event event for account {} ", paymentStateContext.getAccount().getId(), e);
+ logger.warn(String.format("Failed to post event %s", event), e);
}
}
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/dispatcher/PaymentPluginDispatcher.java b/payment/src/main/java/org/killbill/billing/payment/dispatcher/PaymentPluginDispatcher.java
index 8454892..8b6dbb2 100644
--- a/payment/src/main/java/org/killbill/billing/payment/dispatcher/PaymentPluginDispatcher.java
+++ b/payment/src/main/java/org/killbill/billing/payment/dispatcher/PaymentPluginDispatcher.java
@@ -48,19 +48,19 @@ public class PaymentPluginDispatcher {
log.debug("Successful plugin(s) call of {} for account {} with result {}", pluginNames, accountId, result);
return result;
} catch (final TimeoutException e) {
- final String errorMessage = String.format("TimeoutException while executing the plugin(s) %s", pluginNames);
+ final String errorMessage = String.format("TimeoutException while executing plugin='%s'", pluginNames);
log.warn(errorMessage, e);
throw new PaymentApiException(ErrorCode.PAYMENT_PLUGIN_TIMEOUT, accountId, errorMessage);
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
- final String errorMessage = String.format("InterruptedException while executing the following plugin(s): %s", pluginNames);
+ final String errorMessage = String.format("InterruptedException while executing plugin='%s'", pluginNames);
log.warn(errorMessage, e);
throw new PaymentApiException(ErrorCode.PAYMENT_INTERNAL_ERROR, MoreObjects.firstNonNull(e.getMessage(), errorMessage));
} catch (final ExecutionException e) {
if (e.getCause() instanceof PaymentApiException) {
throw (PaymentApiException) e.getCause();
} else if (e.getCause() instanceof LockFailedException) {
- final String format = String.format("Failed to lock account %s", accountExternalKey);
+ final String format = String.format("Failed to lock accountExternalKey='%s'", accountExternalKey);
log.error(format, e);
throw new PaymentApiException(ErrorCode.PAYMENT_INTERNAL_ERROR, format);
} else {
diff --git a/payment/src/main/java/org/killbill/billing/payment/glue/DefaultPaymentService.java b/payment/src/main/java/org/killbill/billing/payment/glue/DefaultPaymentService.java
index 93603b1..e27a8b2 100644
--- a/payment/src/main/java/org/killbill/billing/payment/glue/DefaultPaymentService.java
+++ b/payment/src/main/java/org/killbill/billing/payment/glue/DefaultPaymentService.java
@@ -77,7 +77,7 @@ public class DefaultPaymentService implements PaymentService {
eventBus.register(paymentBusEventHandler);
eventBus.register(tagHandler);
} catch (final PersistentBus.EventBusException e) {
- log.error("Unable to register with the EventBus!", e);
+ log.error("Failed to register bus handlers", e);
}
paymentExecutors.initialize();
retryService.initialize();
@@ -96,7 +96,7 @@ public class DefaultPaymentService implements PaymentService {
eventBus.unregister(paymentBusEventHandler);
eventBus.unregister(tagHandler);
} catch (final PersistentBus.EventBusException e) {
- throw new RuntimeException("Unable to unregister to the EventBus!", e);
+ throw new RuntimeException("Failed to unregister bus handlers", e);
}
retryService.stop();
janitor.stop();
diff --git a/payment/src/main/java/org/killbill/billing/payment/invoice/InvoicePaymentControlPluginApi.java b/payment/src/main/java/org/killbill/billing/payment/invoice/InvoicePaymentControlPluginApi.java
index 7ccaba6..0d6c64f 100644
--- a/payment/src/main/java/org/killbill/billing/payment/invoice/InvoicePaymentControlPluginApi.java
+++ b/payment/src/main/java/org/killbill/billing/payment/invoice/InvoicePaymentControlPluginApi.java
@@ -154,16 +154,16 @@ public final class InvoicePaymentControlPluginApi implements PaymentControlPlugi
existingInvoicePayment = invoiceApi.getInvoicePaymentForAttempt(paymentControlContext.getPaymentId(), internalContext);
if (existingInvoicePayment != null && existingInvoicePayment.isSuccess()) {
// Only one successful purchase per payment (the invoice could be linked to multiple successful payments though)
- log.info("onSuccessCall was already completed for payment purchase: " + paymentControlContext.getPaymentId());
+ log.info("onSuccessCall was already completed for purchase paymentId='{}'", paymentControlContext.getPaymentId());
} else {
final BigDecimal invoicePaymentAmount;
if (paymentControlContext.getCurrency() == paymentControlContext.getProcessedCurrency()) {
invoicePaymentAmount = paymentControlContext.getProcessedAmount();
} else {
- log.warn("Currency {} of invoice payment {} doesn't match invoice currency {}, assuming it is a full payment" , paymentControlContext.getProcessedCurrency(), paymentControlContext.getPaymentId(), paymentControlContext.getCurrency());
+ log.warn("processedCurrency='{}' of invoice paymentId='{}' doesn't match invoice currency='{}', assuming it is a full payment" , paymentControlContext.getProcessedCurrency(), paymentControlContext.getPaymentId(), paymentControlContext.getCurrency());
invoicePaymentAmount = paymentControlContext.getAmount();
}
- log.debug("Notifying invoice of successful payment: id={}, amount={}, currency={}, invoiceId={}", paymentControlContext.getPaymentId(), invoicePaymentAmount, paymentControlContext.getCurrency(), invoiceId);
+ log.debug("Notifying invoice of successful paymentId='{}', amount='{}', currency='{}', invoiceId='{}'", paymentControlContext.getPaymentId(), invoicePaymentAmount, paymentControlContext.getCurrency(), invoiceId);
invoiceApi.notifyOfPayment(invoiceId,
invoicePaymentAmount,
paymentControlContext.getCurrency(),
@@ -186,7 +186,7 @@ public final class InvoicePaymentControlPluginApi implements PaymentControlPlugi
existingInvoicePayment = invoiceApi.getInvoicePaymentForChargeback(paymentControlContext.getPaymentId(), internalContext);
if (existingInvoicePayment != null) {
// We don't support partial chargebacks (yet?)
- log.info("onSuccessCall was already completed for payment chargeback: " + paymentControlContext.getPaymentId());
+ log.info("onSuccessCall was already completed for chargeback paymentId='{}'", paymentControlContext.getPaymentId());
} else {
final InvoicePayment linkedInvoicePayment = invoiceApi.getInvoicePaymentForAttempt(paymentControlContext.getPaymentId(), internalContext);
@@ -211,7 +211,7 @@ public final class InvoicePaymentControlPluginApi implements PaymentControlPlugi
throw new IllegalStateException("Unexpected transactionType " + transactionType);
}
} catch (final InvoiceApiException e) {
- log.error("InvoicePaymentControlPluginApi onSuccessCall failed for attemptId = " + paymentControlContext.getAttemptPaymentId() + ", transactionType = " + transactionType, e);
+ log.error(String.format("onSuccessCall failed for attemptId='%s', transactionType='%s'", paymentControlContext.getAttemptPaymentId(), transactionType), e);
}
return new DefaultOnSuccessPaymentControlResult();
@@ -503,15 +503,13 @@ public final class InvoicePaymentControlPluginApi implements PaymentControlPlugi
private BigDecimal validateAndComputePaymentAmount(final Invoice invoice, @Nullable final BigDecimal inputAmount, final boolean isApiPayment) {
if (invoice.getBalance().compareTo(BigDecimal.ZERO) <= 0) {
- log.info("Invoice " + invoice.getId() + " has already been paid");
+ log.info("invoiceId='{}' has already been paid", invoice.getId());
return BigDecimal.ZERO;
}
if (isApiPayment &&
inputAmount != null &&
invoice.getBalance().compareTo(inputAmount) < 0) {
- log.info("Invoice " + invoice.getId() +
- " has a balance of " + invoice.getBalance().floatValue() +
- " less than retry payment amount of " + inputAmount.floatValue());
+ log.info("invoiceId='{}' has a balance='{}' < retry paymentAmount='{}'", invoice.getId(), invoice.getBalance().floatValue(), inputAmount.floatValue());
return BigDecimal.ZERO;
}
if (inputAmount == null) {
diff --git a/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentControlProviderPluginRegistry.java b/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentControlProviderPluginRegistry.java
index 40a3ad5..9ebbb2e 100644
--- a/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentControlProviderPluginRegistry.java
+++ b/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentControlProviderPluginRegistry.java
@@ -41,13 +41,13 @@ public class DefaultPaymentControlProviderPluginRegistry implements OSGIServiceR
@Override
public void registerService(final OSGIServiceDescriptor desc, final PaymentControlPluginApi service) {
- log.info("DefaultPaymentControlProviderPluginRegistry registering service " + desc.getRegistrationName());
+ log.info("Registering service='{}'", desc.getRegistrationName());
pluginsByName.put(desc.getRegistrationName(), service);
}
@Override
public void unregisterService(final String serviceName) {
- log.info("DefaultPaymentControlProviderPluginRegistry unregistering service " + serviceName);
+ log.info("Unregistering service='{}'", serviceName);
pluginsByName.remove(serviceName);
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentProviderPluginRegistry.java b/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentProviderPluginRegistry.java
index 5d9c44e..ce8d315 100644
--- a/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentProviderPluginRegistry.java
+++ b/payment/src/main/java/org/killbill/billing/payment/provider/DefaultPaymentProviderPluginRegistry.java
@@ -45,13 +45,13 @@ public class DefaultPaymentProviderPluginRegistry implements OSGIServiceRegistra
@Override
public void registerService(final OSGIServiceDescriptor desc, final PaymentPluginApi service) {
- log.info("DefaultPaymentProviderPluginRegistry registering service " + desc.getRegistrationName());
+ log.info("Registering service='{}'", desc.getRegistrationName());
pluginsByName.put(desc.getRegistrationName(), service);
}
@Override
public void unregisterService(final String serviceName) {
- log.info("DefaultPaymentProviderPluginRegistry unregistering service " + serviceName);
+ log.info("Unregistering service='{}'", serviceName);
pluginsByName.remove(serviceName);
}
diff --git a/payment/src/main/java/org/killbill/billing/payment/retry/BaseRetryService.java b/payment/src/main/java/org/killbill/billing/payment/retry/BaseRetryService.java
index 7757b65..ded591c 100644
--- a/payment/src/main/java/org/killbill/billing/payment/retry/BaseRetryService.java
+++ b/payment/src/main/java/org/killbill/billing/payment/retry/BaseRetryService.java
@@ -124,10 +124,10 @@ public abstract class BaseRetryService implements RetryService {
}
}
} catch (final NoSuchNotificationQueue e) {
- log.error(String.format("Failed to retrieve notification queue %s:%s", DefaultPaymentService.SERVICE_NAME, getQueueName()));
+ log.error("Failed to retrieve notification queue='{}', service='{}'", getQueueName(), DefaultPaymentService.SERVICE_NAME);
return false;
} catch (final IOException e) {
- log.error(String.format("Failed to serialize notificationQueue event for objectId %s", objectId));
+ log.error("Failed to serialize notificationQueue event for objectId='{}'", objectId);
return false;
}
return true;
diff --git a/profiles/killbill/src/main/java/org/killbill/billing/server/DefaultServerService.java b/profiles/killbill/src/main/java/org/killbill/billing/server/DefaultServerService.java
index 0306248..a085bfa 100644
--- a/profiles/killbill/src/main/java/org/killbill/billing/server/DefaultServerService.java
+++ b/profiles/killbill/src/main/java/org/killbill/billing/server/DefaultServerService.java
@@ -55,7 +55,7 @@ public class DefaultServerService implements ServerService {
try {
bus.register(pushNotificationListener);
} catch (final EventBusException e) {
- log.warn("Failed to initialize Server service :", e);
+ log.warn("Failed to register PushNotificationListener", e);
}
}
@@ -64,7 +64,7 @@ public class DefaultServerService implements ServerService {
try {
bus.unregister(pushNotificationListener);
} catch (final EventBusException e) {
- log.warn("Failed to stop Server service :", e);
+ log.warn("Failed to unregister PushNotificationListener", e);
}
}
}
diff --git a/profiles/killbill/src/main/java/org/killbill/billing/server/filters/ProfilingContainerResponseFilter.java b/profiles/killbill/src/main/java/org/killbill/billing/server/filters/ProfilingContainerResponseFilter.java
index 38402b5..9f7e05f 100644
--- a/profiles/killbill/src/main/java/org/killbill/billing/server/filters/ProfilingContainerResponseFilter.java
+++ b/profiles/killbill/src/main/java/org/killbill/billing/server/filters/ProfilingContainerResponseFilter.java
@@ -63,7 +63,7 @@ public class ProfilingContainerResponseFilter implements ContainerRequestFilter,
profilingData.addStart(ProfilingFeatureType.JAXRS, request.getPath());
}
} catch (IllegalArgumentException e) {
- log.info("Profiling data output " + profilingHeaderRequest + " is not supported, profiling NOT enabled");
+ log.info("Profiling data output {} is not supported, profiling NOT enabled", profilingHeaderRequest);
}
}
return request;
diff --git a/profiles/killbill/src/main/java/org/killbill/billing/server/notifications/PushNotificationListener.java b/profiles/killbill/src/main/java/org/killbill/billing/server/notifications/PushNotificationListener.java
index d821177..8681047 100644
--- a/profiles/killbill/src/main/java/org/killbill/billing/server/notifications/PushNotificationListener.java
+++ b/profiles/killbill/src/main/java/org/killbill/billing/server/notifications/PushNotificationListener.java
@@ -113,7 +113,7 @@ public class PushNotificationListener {
});
response = futureStatus.get(timeoutSec, TimeUnit.SECONDS);
} catch (final Exception e) {
- log.warn(String.format("Failed to push notification %s for the tenant %s", url, tenantId), e);
+ log.warn(String.format("Failed to push notification url='%s', tenantId='%s'", url, tenantId), e);
return false;
}
return response.getStatusCode() >= 200 && response.getStatusCode() < 300;
diff --git a/profiles/killbill/src/main/java/org/killbill/billing/server/security/TenantFilter.java b/profiles/killbill/src/main/java/org/killbill/billing/server/security/TenantFilter.java
index 7f2a2bb..1a3ad56 100644
--- a/profiles/killbill/src/main/java/org/killbill/billing/server/security/TenantFilter.java
+++ b/profiles/killbill/src/main/java/org/killbill/billing/server/security/TenantFilter.java
@@ -104,7 +104,7 @@ public class TenantFilter implements Filter {
chain.doFilter(request, response);
} catch (final TenantApiException e) {
// Should never happen since Shiro validated the credentials?
- log.warn("Couldn't find the tenant?", e);
+ log.error("Couldn't find the tenant? - should never happen!", e);
}
}
diff --git a/profiles/killbill/src/main/resources/logback.xml b/profiles/killbill/src/main/resources/logback.xml
index 3e86876..4a56c96 100644
--- a/profiles/killbill/src/main/resources/logback.xml
+++ b/profiles/killbill/src/main/resources/logback.xml
@@ -21,7 +21,8 @@
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
- <pattern>%date [%thread] %-5level %logger{36} - %maskedMsg%n%ex</pattern>
+ <!-- See http://jira.qos.ch/browse/LOGBACK-262 -->
+ <pattern>%date{"yyyy-MM-dd'T'HH:mm:ss,SSSZ", UTC} thread='%thread', level='%level', logger='%logger{0}', %maskedMsg%n%ex</pattern>
</encoder>
</appender>
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java b/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java
index 4b17ee0..42889d1 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java
@@ -315,7 +315,7 @@ public class DefaultSubscriptionInternalApi extends SubscriptionApiBase implemen
}
}
} catch (final CatalogApiException e) {
- log.warn("Failed to get subscriptions, ", e);
+ log.warn(String.format("Failed to get subscriptions for bundleId='%s'", cur.getId()), e);
return null;
}
}
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/engine/core/DefaultSubscriptionBaseService.java b/subscription/src/main/java/org/killbill/billing/subscription/engine/core/DefaultSubscriptionBaseService.java
index 18dd082..24e90c1 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/engine/core/DefaultSubscriptionBaseService.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/engine/core/DefaultSubscriptionBaseService.java
@@ -102,7 +102,7 @@ public class DefaultSubscriptionBaseService implements EventListener, Subscripti
@Override
public void handleReadyNotification(final NotificationEvent inputKey, final DateTime eventDateTime, final UUID fromNotificationQueueUserToken, final Long accountRecordId, final Long tenantRecordId) {
if (!(inputKey instanceof SubscriptionNotificationKey)) {
- log.error("SubscriptionBase service received an unexpected event type {}" + inputKey.getClass().getName());
+ log.error("SubscriptionBase service received an unexpected event className='{}'", inputKey.getClass().getName());
return;
}
@@ -110,7 +110,7 @@ public class DefaultSubscriptionBaseService implements EventListener, Subscripti
final SubscriptionBaseEvent event = dao.getEventById(key.getEventId(), internalCallContextFactory.createInternalTenantContext(tenantRecordId, accountRecordId));
if (event == null) {
// This can be expected if the event is soft deleted (is_active = 0)
- log.info("Failed to extract event for notification key {}", inputKey);
+ log.debug("Failed to extract event for notification key {}", inputKey);
return;
}
@@ -149,7 +149,7 @@ public class DefaultSubscriptionBaseService implements EventListener, Subscripti
try {
final DefaultSubscriptionBase subscription = (DefaultSubscriptionBase) dao.getSubscriptionFromId(event.getSubscriptionId(), context);
if (subscription == null) {
- log.warn("Failed to retrieve subscription for id %s", event.getSubscriptionId());
+ log.warn("Error retrieving subscriptionId='{}'", event.getSubscriptionId());
return;
}
if (subscription.getActiveVersion() > event.getActiveVersion()) {
@@ -176,9 +176,9 @@ public class DefaultSubscriptionBaseService implements EventListener, Subscripti
eventBus.post(busEvent);
}
} catch (final EventBusException e) {
- log.warn("Failed to post subscription event " + event, e);
+ log.warn(String.format("Failed to post event %s", event), e);
} catch (final CatalogApiException e) {
- log.warn("Failed to post subscription event " + event, e);
+ log.warn(String.format("Failed to post event %s", event), e);
}
}
@@ -195,7 +195,7 @@ public class DefaultSubscriptionBaseService implements EventListener, Subscripti
return true;
}
} catch (final SubscriptionBaseError e) {
- log.error(String.format("Failed to insert next phase for subscription %s", subscription.getId()), e);
+ log.error(String.format("Error inserting next phase for subscriptionId='%s'", subscription.getId()), e);
}
return false;
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/engine/dao/DefaultSubscriptionDao.java b/subscription/src/main/java/org/killbill/billing/subscription/engine/dao/DefaultSubscriptionDao.java
index 16e6090..1f655bb 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/engine/dao/DefaultSubscriptionDao.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/engine/dao/DefaultSubscriptionDao.java
@@ -272,19 +272,19 @@ public class DefaultSubscriptionDao extends EntityDaoBase<SubscriptionBundleMode
public UUID inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception {
final SubscriptionModelDao subscriptionModel = entitySqlDaoWrapperFactory.become(SubscriptionSqlDao.class).getById(subscriptionId.toString(), context);
if (subscriptionModel == null) {
- log.error(String.format(ErrorCode.SUB_INVALID_SUBSCRIPTION_ID.getFormat(), subscriptionId.toString()));
+ log.warn(String.format(ErrorCode.SUB_INVALID_SUBSCRIPTION_ID.getFormat(), subscriptionId.toString()));
return null;
}
final UUID bundleId = subscriptionModel.getBundleId();
if (bundleId == null) {
- log.error(String.format(ErrorCode.SUB_GET_NO_BUNDLE_FOR_SUBSCRIPTION.getFormat(), subscriptionId.toString()));
+ log.warn(String.format(ErrorCode.SUB_GET_NO_BUNDLE_FOR_SUBSCRIPTION.getFormat(), subscriptionId.toString()));
return null;
}
final SubscriptionBundleModelDao bundleModel = entitySqlDaoWrapperFactory.become(BundleSqlDao.class).getById(bundleId.toString(), context);
if (bundleModel == null) {
- log.error(String.format(ErrorCode.SUB_GET_INVALID_BUNDLE_ID.getFormat(), bundleId.toString()));
+ log.warn(String.format(ErrorCode.SUB_GET_INVALID_BUNDLE_ID.getFormat(), bundleId.toString()));
return null;
}
return bundleModel.getAccountId();
@@ -1082,7 +1082,7 @@ public class DefaultSubscriptionDao extends EntityDaoBase<SubscriptionBundleMode
final DefaultSubscriptionBase upToDateSubscription = createSubscriptionWithNewEvent(subscription, immediateEvent, context);
notifyBusOfEffectiveImmediateChange(entitySqlDaoWrapperFactory, upToDateSubscription, immediateEvent, seqId, context);
} catch (final CatalogApiException e) {
- log.warn("Failed to post effective event for subscription " + subscription.getId(), e);
+ log.warn(String.format("Failed to post effective event for subscriptionId='%s'", subscription.getId()), e);
}
}
@@ -1098,7 +1098,7 @@ public class DefaultSubscriptionDao extends EntityDaoBase<SubscriptionBundleMode
eventBus.postFromTransaction(busEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post effective event for subscription " + subscription.getId(), e);
+ log.warn(String.format("Failed to post effective event for subscriptionId='%s'", subscription.getId()), e);
}
}
@@ -1107,7 +1107,7 @@ public class DefaultSubscriptionDao extends EntityDaoBase<SubscriptionBundleMode
try {
eventBus.postFromTransaction(new DefaultRequestedSubscriptionEvent(subscription, nextEvent, transitionType, context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken()), entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final EventBusException e) {
- log.warn("Failed to post requested change event for subscription " + subscription.getId(), e);
+ log.warn(String.format("Failed to post requested change event for subscriptionId='%s'", subscription.getId()), e);
}
}
@@ -1134,7 +1134,7 @@ public class DefaultSubscriptionDao extends EntityDaoBase<SubscriptionBundleMode
final List<SubscriptionBundleModelDao> existingBundleModels = transBundleDao.getBundlesFromAccountAndKey(bundleData.getAccountId().toString(), bundleData.getExternalKey(), context);
if (existingBundleModels.size() != 0) {
- log.error(String.format("Attempted to create a bundle for account %s and key %s that already existed, skip...", bundleData.getAccountId().toString(), bundleData.getExternalKey()));
+ log.warn("Bundle already exists for accountId='{}', bundleExternalKey='{}'", bundleData.getAccountId(), bundleData.getExternalKey());
return;
}
diff --git a/tenant/src/main/java/org/killbill/billing/tenant/api/TenantCacheInvalidation.java b/tenant/src/main/java/org/killbill/billing/tenant/api/TenantCacheInvalidation.java
index a49f041..752947a 100644
--- a/tenant/src/main/java/org/killbill/billing/tenant/api/TenantCacheInvalidation.java
+++ b/tenant/src/main/java/org/killbill/billing/tenant/api/TenantCacheInvalidation.java
@@ -198,7 +198,7 @@ public class TenantCacheInvalidation {
try {
parent.getEventBus().post(event);
} catch (final EventBusException e) {
- logger.warn("Failed post bus event " + event, e);
+ logger.warn(String.format("Failed to post event %s", event), e);
}
}
} else {
diff --git a/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastApi.java b/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastApi.java
index 7c24739..01be469 100644
--- a/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastApi.java
+++ b/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastApi.java
@@ -51,7 +51,7 @@ public class DefaultBroadcastApi implements BroadcastApi {
try {
eventBus.post(busEvent);
} catch (final EventBusException e) {
- logger.warn("Failed to deliver bus event ", e);
+ logger.warn(String.format("Failed to post event %s", event), e);
}
} else {
final BroadcastModelDao modelDao = new BroadcastModelDao(serviceName, type, event, createdDate, createdBy);
diff --git a/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastService.java b/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastService.java
index 7ee1a99..4dd7a6c 100644
--- a/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastService.java
+++ b/util/src/main/java/org/killbill/billing/util/broadcast/DefaultBroadcastService.java
@@ -93,7 +93,7 @@ public class DefaultBroadcastService implements BroadcastService {
broadcastExecutor.shutdown();
boolean success = broadcastExecutor.awaitTermination(TERMINATION_TIMEOUT_SEC, TimeUnit.SECONDS);
if (!success) {
- logger.warn("BroadcastExecutor failed to complete termination within " + TERMINATION_TIMEOUT_SEC + "sec");
+ logger.warn("BroadcastExecutor failed to complete termination within {} sec", TERMINATION_TIMEOUT_SEC);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -139,11 +139,11 @@ public class DefaultBroadcastService implements BroadcastService {
return;
}
+ final BroadcastInternalEvent event = new DefaultBroadcastInternalEvent(cur.getServiceName(), cur.getType(), cur.getEvent());
try {
- final BroadcastInternalEvent event = new DefaultBroadcastInternalEvent(cur.getServiceName(), cur.getType(), cur.getEvent());
eventBus.post(event);
} catch (final EventBusException e) {
- logger.error("Failed to send event BroadcastInternalEvent: ", e);
+ logger.warn(String.format("Failed to post event %s", event), e);
} finally {
parent.setLatestRecordIdProcessed(cur.getRecordId());
}
diff --git a/util/src/main/java/org/killbill/billing/util/cache/TenantCatalogCacheLoader.java b/util/src/main/java/org/killbill/billing/util/cache/TenantCatalogCacheLoader.java
index 897e75d..b3f9305 100644
--- a/util/src/main/java/org/killbill/billing/util/cache/TenantCatalogCacheLoader.java
+++ b/util/src/main/java/org/killbill/billing/util/cache/TenantCatalogCacheLoader.java
@@ -72,11 +72,10 @@ public class TenantCatalogCacheLoader extends BaseCacheLoader {
return null;
}
try {
- log.info("Loading catalog cache for tenant " + internalTenantContext.getTenantRecordId());
+ log.info("Loading catalog cache for tenantRecordId='{}'", internalTenantContext.getTenantRecordId());
return callback.loadCatalog(catalogXMLs, tenantRecordId);
} catch (final CatalogApiException e) {
- throw new IllegalStateException(String.format("Failed to de-serialize catalog for tenant %s : %s",
- internalTenantContext.getTenantRecordId(), e.getMessage()), e);
+ throw new IllegalStateException(String.format("Failed to de-serialize catalog for tenantRecordId='%s'", internalTenantContext.getTenantRecordId()), e);
}
}
diff --git a/util/src/main/java/org/killbill/billing/util/customfield/dao/DefaultCustomFieldDao.java b/util/src/main/java/org/killbill/billing/util/customfield/dao/DefaultCustomFieldDao.java
index 1416fb4..e937b00 100644
--- a/util/src/main/java/org/killbill/billing/util/customfield/dao/DefaultCustomFieldDao.java
+++ b/util/src/main/java/org/killbill/billing/util/customfield/dao/DefaultCustomFieldDao.java
@@ -146,7 +146,7 @@ public class DefaultCustomFieldDao extends EntityDaoBase<CustomFieldModelDao, Cu
try {
bus.postFromTransaction(customFieldEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final PersistentBus.EventBusException e) {
- log.warn("Failed to post tag event for custom field " + customField.getId().toString(), e);
+ log.warn(String.format("Failed to post tag event for customFieldId='%s'", customField.getId().toString()), e);
}
}
diff --git a/util/src/main/java/org/killbill/billing/util/email/DefaultEmailSender.java b/util/src/main/java/org/killbill/billing/util/email/DefaultEmailSender.java
index 7c5c8f2..7f8bac4 100644
--- a/util/src/main/java/org/killbill/billing/util/email/DefaultEmailSender.java
+++ b/util/src/main/java/org/killbill/billing/util/email/DefaultEmailSender.java
@@ -89,7 +89,7 @@ public class DefaultEmailSender implements EmailSender {
email.setSSL(config.useSSL());
- log.info("Sending email to {}, cc {}, subject {}", new Object[]{to, cc, subject});
+ log.info("Sending email to='{}', cc='{}', subject='{}'", to, cc, subject);
email.send();
} catch (EmailException ee) {
throw new EmailApiException(ee, ErrorCode.EMAIL_SENDING_FAILED);
diff --git a/util/src/main/java/org/killbill/billing/util/entity/dao/DefaultPaginationHelper.java b/util/src/main/java/org/killbill/billing/util/entity/dao/DefaultPaginationHelper.java
index a417357..539f897 100644
--- a/util/src/main/java/org/killbill/billing/util/entity/dao/DefaultPaginationHelper.java
+++ b/util/src/main/java/org/killbill/billing/util/entity/dao/DefaultPaginationHelper.java
@@ -74,7 +74,7 @@ public class DefaultPaginationHelper {
maxNbRecords = Math.max(maxNbRecords, pages.getMaxNbRecords());
}
} catch (final BillingExceptionBase e) {
- log.warn("Error while searching plugin " + pluginName, e);
+ log.warn(String.format("Error while searching plugin='%s'", pluginName), e);
// Non-fatal, continue to search other plugins
}
}
diff --git a/util/src/main/java/org/killbill/billing/util/security/shiro/realm/KillBillJndiLdapRealm.java b/util/src/main/java/org/killbill/billing/util/security/shiro/realm/KillBillJndiLdapRealm.java
index 1c7c00f..ddbd3bb 100644
--- a/util/src/main/java/org/killbill/billing/util/security/shiro/realm/KillBillJndiLdapRealm.java
+++ b/util/src/main/java/org/killbill/billing/util/security/shiro/realm/KillBillJndiLdapRealm.java
@@ -137,7 +137,7 @@ public class KillBillJndiLdapRealm extends JndiLdapRealm {
systemLdapCtx = ldapContextFactory.getSystemLdapContext();
return findLDAPGroupsForUser(username, systemLdapCtx);
} catch (AuthenticationException ex) {
- log.info("LDAP authentication exception: " + ex.getLocalizedMessage());
+ log.info("LDAP authentication exception='{}'", ex.getLocalizedMessage());
return ImmutableSet.<String>of();
} finally {
LdapUtils.closeContext(systemLdapCtx);
diff --git a/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDao.java b/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDao.java
index 62543e5..70e1a2f 100644
--- a/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDao.java
+++ b/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDao.java
@@ -142,7 +142,7 @@ public class DefaultTagDao extends EntityDaoBase<TagModelDao, Tag, TagApiExcepti
try {
bus.postFromTransaction(tagEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final PersistentBus.EventBusException e) {
- log.warn("Failed to post tag event for tag " + tag.getId().toString(), e);
+ log.warn(String.format("Failed to post tag event for tagId='%s'", tag.getId().toString()), e);
}
}
diff --git a/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDefinitionDao.java b/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDefinitionDao.java
index 9039976..babe3e6 100644
--- a/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDefinitionDao.java
+++ b/util/src/main/java/org/killbill/billing/util/tag/dao/DefaultTagDefinitionDao.java
@@ -184,7 +184,7 @@ public class DefaultTagDefinitionDao extends EntityDaoBase<TagDefinitionModelDao
try {
bus.postFromTransaction(tagDefinitionEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final PersistentBus.EventBusException e) {
- log.warn("Failed to post tag definition creation event for tag " + tagDefinition.getId(), e);
+ log.warn(String.format("Failed to post tag definition creation event for tagDefinitionId='%s'", tagDefinition.getId()), e);
}
return tagDefinition;
@@ -263,7 +263,7 @@ public class DefaultTagDefinitionDao extends EntityDaoBase<TagDefinitionModelDao
try {
bus.postFromTransaction(tagDefinitionEvent, entitySqlDaoWrapperFactory.getHandle().getConnection());
} catch (final PersistentBus.EventBusException e) {
- log.warn("Failed to post tag definition event for tag " + tagDefinition.getId().toString(), e);
+ log.warn(String.format("Failed to post tag definition event for tagDefinitionId='%s'", tagDefinition.getId().toString()), e);
}
}