- /* Wild card to disable ALL logger. */
- if (name.trim().equals("*")) {
- String loggerName;
- Enumeration loggers = handler.logManager.getLoggerNames();
- while (loggers.hasMoreElements()) {
- loggerName = loggers.nextElement().toString();
- /* Somehow there is always an empty string at the end. */
- if (loggerName == "") {
- continue;
- }
-
- logger = handler.logManager.getLogger(loggerName);
- logger.removeHandler(handler);
- }
- this.code = lttng_jul_ret_code.CODE_SUCCESS_CMD;
+ /*
+ * Try to remove the logger name from the events map and if we
+ * can't, just skip the refcount update since the event was never
+ * enabled.
+ */
+ event = handler.enabledEvents.remove(this.name);
+ if (event == null) {
+ /* The event didn't exists so skip updating the refcount. */
+ this.code = lttng_jul_ret_code.CODE_INVALID_CMD;