I have extended the java.util.logging.Handler class, but I am unable to disable the global logging Handler ej.util.logging.handler.DefaultHandler from handling my logger output.
I can set the logger Logger.GLOBAL_LOGGER_NAME logging to Level.OFF, which stops the global logger from outputting, but other loggers using getLogger(“SomeString”) are still executing the global Default handler, as the parent handler code is called without respect to the parents (Level.OFF) filter level.
I cannot see a way to ‘extract’ the global Handler information such that I would be able to call removeHandler() so cannot see an obvious way of disabling the global DefaultHandler?
I have however realised (whilst writing this) that I can subclass the Logger and use the protected Logger(String, String) constructor and it does not set the parent.
Should the global “parent” logger use its filter level and not that of the child’s though?