code: public synchronized static void destroyInstance(SyslogIF syslog) throws SyslogRuntimeException {
          if (syslog == null) {
              return;
          }
  
          String protocol = syslog.getProtocol().toLowerCase();
  
          if (instances.containsKey(protocol)) {
              try {
                  syslog.shutdown();
  
              } finally {
                  instances.remove(protocol);
              }
  
          } else {
              throw new SyslogRuntimeException("Cannot destroy protocol \"%s\" instance; call shutdown instead", protocol);
          }
      }
docs: destroyInstance() gracefully shuts down the specified Syslog instance and
  removes it from Syslog4j.
  
  @param syslog - the Syslog instance to destroy
  @throws SyslogRuntimeException