Lines Matching refs:Logger
45 * <li> Manages a hierarchical namespace of Logger objects. All
98 * handlers on the root Logger (the Logger named ""). Each class
160 private Logger rootLogger;
195 // Create and retain Logger for the root of the namespace.
205 // Adding the global Logger. Doing so in the Logger.<clinit>
207 Logger.global.setLogManager(manager);
210 manager.addLogger(Logger.global);
211 manager.systemContext.addLocalLogger(Logger.global, false);
212 manager.userContext.addLocalLogger(Logger.global, false);
296 // Platform loggers begin to delegate to java.util.logging.Logger
358 // from a system thread but Logger.getLogger might be called from
397 // This method will always return a non-null Logger object.
399 // adding a new Logger object is handled by addLogger().
402 // add a new Logger or return the one that has been added previously
405 Logger demandLogger(String name, String resourceBundleName, Class<?> caller) {
406 Logger result = getLogger(name);
409 Logger newLogger = new Logger(name, resourceBundleName, caller);
412 // We successfully added the new Logger that we
417 // We didn't add the new Logger that we created above
418 // because another thread added a Logger with the same
420 // to addLogger(). We have to refetch the Logger because
421 // addLogger() returns a boolean instead of the Logger
423 // the other Logger is not holding a strong reference to
424 // the other Logger, then it is possible for the other
425 // Logger to be GC'ed after we saw it in addLogger() and
434 Logger demandSystemLogger(String name, String resourceBundleName) {
436 final Logger sysLogger = systemContext.demandLogger(name, resourceBundleName);
442 Logger logger;
458 final Logger l = logger;
492 Logger demandLogger(String name, String resourceBundleName) {
494 // get a Logger. So delegate to the LogManager to do the work.
510 ensureDefaultLogger(Logger.global);
515 synchronized Logger findLogger(String name) {
523 Logger logger = ref.get();
538 private void ensureAllDefaultLoggers(Logger logger) {
544 if (!Logger.GLOBAL_LOGGER_NAME.equals(name)) {
545 ensureDefaultLogger(Logger.global);
550 private void ensureDefaultLogger(Logger logger) {
555 // method be called for anything else than Logger.global
558 || logger != Logger.global && logger != manager.rootLogger) {
561 // Logger.global nor manager.rootLogger indicates a serious
582 boolean addLocalLogger(Logger logger) {
589 synchronized boolean addLocalLogger(Logger logger, boolean addDefaultLoggersIfNeeded) {
611 // It's possible that the Logger was GC'ed after a
637 Logger parent = null;
675 private void processParentHandlers(final Logger logger, final String name) {
741 Logger demandLogger(String name, String resourceBundleName) {
742 Logger result = findLogger(name);
745 Logger newLogger = new Logger(name, resourceBundleName);
748 // We successfully added the new Logger that we
752 // We didn't add the new Logger that we created above
753 // because another thread added a Logger with the same
755 // to addLogger(). We have to refetch the Logger because
756 // addLogger() returns a boolean instead of the Logger
758 // the other Logger is not holding a strong reference to
759 // the other Logger, then it is possible for the other
760 // Logger to be GC'ed after we saw it in addLogger() and
775 private void loadLoggerHandlers(final Logger logger, final String name,
812 // loggerRefQueue holds LoggerWeakRef objects for Logger objects
814 private final ReferenceQueue<Logger> loggerRefQueue
818 // Helper class for managing WeakReferences to Logger objects.
824 // the named Logger that is being GC'ed.
826 // - has a weak reference to a named Logger
829 // Logger.kids
830 // - has a weak reference to each direct child Logger; this
837 final class LoggerWeakRef extends WeakReference<Logger> {
840 private WeakReference<Logger> parentRef; // for kids cleanup
842 LoggerWeakRef(Logger logger) {
851 // if we have a LogNode, then we were a named Logger
854 name = null; // clear our ref to the Logger's name
861 // this LoggerWeakRef has or had a parent Logger
862 Logger parent = parentRef.get();
864 // the parent Logger is still there so clear the
865 // parent Logger's weak ref to us
868 parentRef = null; // clear our weak ref to the parent Logger
878 void setParentRef(WeakReference<Logger> parentRef) {
884 // Drain some Logger objects that have been GC'ed.
887 // and by Logger.getAnonymousLogger(String) so we'll drain up to
888 // MAX_ITERATIONS GC'ed Loggers for every Logger we add.
921 // a Logger object has been GC'ed so clean it up
930 * The Logger factory methods call this method to register each
931 * newly created Logger.
933 * The application should retain its own reference to the Logger
942 public boolean addLogger(Logger logger) {
961 private static void doSetLevel(final Logger logger, final Level level) {
979 private static void doSetParent(final Logger logger, final Logger parent) {
1001 * It is also important to note that the Logger associated with the
1003 * is no strong reference to the Logger. The caller of this method
1005 * the case where the Logger has been garbage collected.
1010 public Logger getLogger(String name) {
1020 * of a Logger, not a strong reference to the Logger itself.
1021 * The returned String does nothing to prevent the Logger from being
1025 * handle the case where the Logger has been garbage collected in the
1042 * applied using Logger.setLevel(), if the target Logger exists.
1120 Logger logger = cx.findLogger(name);
1129 private void resetLogger(Logger logger) {
1130 // Close all the Logger's handlers.
1187 * applied using Logger.setLevel(), if the target Logger exists.
1389 void walkAndSetParent(Logger parent) {
1397 Logger logger = (ref == null) ? null : ref.get();
1407 // We use a subclass of Logger for the root logger, so
1410 private class RootLogger extends Logger {
1457 Logger l = cx.findLogger(name);