Printing java logger configuration

I have been wondering for some time how to print out a list with details how loggers were configured.
In order to work, one requires to create at least one logger instance of each logger that shall be listed.
I will provide further details in future.

public void print(PrintStream out) {
	out.println("ConfiguraĆ§Ć£o de log: ");
	LogManager logManager = LogManager.getLogManager();
	Enumeration<String> loggerNames = logManager.getLoggerNames();
	Set<String> names = new TreeSet<String>();
	Set<Handler> handlerSet = new HashSet<Handler>();
	while (loggerNames.hasMoreElements()) {
		String name = loggerNames.nextElement();
		names.add(name);
	}
	for (String name : names) {
		Logger logger = logManager.getLogger(name);
		String nome = logger.getName();
		if (nome.length() == 0) nome = "<root>";
//		boolean inheritedLevel = false;
		Level level = logger.getLevel();
//		boolean inheritedHandler = false;
		Handler[] handlers = logger.getHandlers();

		Logger parentLevelLogger = null;
		if (level == null) {
			parentLevelLogger = logger.getParent();
			while (parentLevelLogger != null && level == null) {
				Level parentLevel = parentLevelLogger.getLevel();
				if (parentLevel != null) {
					level = parentLevel;
				} else {
					parentLevelLogger = parentLevelLogger.getParent();
				}
			}
		}
		Logger parentHandlerLogger = null;
		if (handlers == null) {
			parentHandlerLogger = logger.getParent();
			while (parentHandlerLogger != null && handlers == null) {
				Handler[] parentHandlers = parentHandlerLogger.getHandlers();
				if (parentHandlers != null) {
					handlers = parentHandlers;
				} else {
					parentHandlerLogger = parentHandlerLogger.getParent();
				}
			}
		}
		String nivel = "?";
		if (level != null) nivel = level.getName();
		if (parentLevelLogger != null) {
			if (parentLevelLogger.getName().length() == 0)
				nivel = "<root>:"+nivel;
			else
				nivel = parentLevelLogger.getName()+":"+nivel;
		}
		String lista = "?";
		if (handlers != null) {
			List<Handler> list = Arrays.asList(handlers);
			if (list.size() == 0) {
				lista = "";
			} else {
				lista = null;
				for (Handler handler : list) {
					if (lista == null) lista = handler.getClass().getName();
					else lista += ", " + handler.getClass().getSimpleName();
				}
			}
		}
		if (parentHandlerLogger != null) {
			if (parentHandlerLogger.getName().length() == 0)
				nivel = "<root>:"+lista;
			else
				nivel = parentHandlerLogger.getName()+":"+lista;
		}
		out.format(" - %s (%s): %s\n", nome, nivel, lista);
	}
	for (Handler handler : handlerSet) {
		String nome = handler.getClass().getSimpleName();
		String nivel = handler.getLevel().getName();
		out.format(" - %s (%s)\n", nome, nivel);
	}
}