code: public static void logError(BundleContext pBundleContext, String pMessage, Throwable pThrowable) {
  
          final ServiceReference lRef = pBundleContext.getServiceReference(LogService.class.getName());
          if (lRef != null) {
              try {
                  final LogService logService = (LogService) pBundleContext.getService(lRef);
                  if (logService != null) {
                      logService.log(LogService.LOG_ERROR, pMessage, pThrowable);
                      return;
                  }
              } finally {
                  pBundleContext.ungetService(lRef);
              }
          }
          System.err.println("Jolokia-Error: " + pMessage + " : " + pThrowable.getMessage());
      }
docs: Log error to a logging service (if available), otherwise log to std error
  
  @param pBundleContext bundle context to lookup LogService
  @param pMessage message to log
  @param pThrowable an exception to log