@Override public org.apache.activemq.broker.region.Destination addDestination( ConnectionContext context, ActiveMQDestination destination, boolean create) throws Exception { if (isLogAll() || isLogInternalEvents()) { LOG.info( "Adding destination: {}:{}", destination.getDestinationTypeAsString(), destination.getPhysicalName()); } return super.addDestination(context, destination, create); }
@Override public void removeDestination( ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { if (isLogAll() || isLogInternalEvents()) { LOG.info( "Removing destination: {}:{}", destination.getDestinationTypeAsString(), destination.getPhysicalName()); } super.removeDestination(context, destination, timeout); }
private void logSend(Message copy) { Logger perDestinationsLogger = LOG; if (isPerDestinationLogger()) { ActiveMQDestination destination = copy.getDestination(); perDestinationsLogger = LoggerFactory.getLogger( LOG.getName() + "." + destination.getDestinationTypeAsString() + "." + destination.getPhysicalName()); } perDestinationsLogger.info("Sending message: {}", copy); }
@Override public Set<ActiveMQDestination> getDurableDestinations() { Set<ActiveMQDestination> result = super.getDurableDestinations(); if (isLogAll() || isLogInternalEvents()) { if (result == null) { LOG.info("Get Durable Destinations returned empty list."); } else { StringBuffer destinations = new StringBuffer(); for (ActiveMQDestination dest : result) { destinations.append(destinations.length() > 0 ? ", " : ""); destinations.append(dest.getPhysicalName()); } LOG.info("Get Durable Destinations: {}", destinations); } } return result; }