diff options
Diffstat (limited to 'java/util/logging/Logger.java')
-rw-r--r-- | java/util/logging/Logger.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/java/util/logging/Logger.java b/java/util/logging/Logger.java index 567020ef7..46588e542 100644 --- a/java/util/logging/Logger.java +++ b/java/util/logging/Logger.java @@ -41,6 +41,8 @@ package java.util.logging; import java.util.List; import java.util.MissingResourceException; import java.util.ResourceBundle; +import java.security.AccessController; +import java.security.PrivilegedAction; /** * A Logger is used for logging information about events. Usually, there @@ -76,7 +78,20 @@ public class Logger * products are supposed to create and use their own Loggers, so * they can be controlled individually. */ - public static final Logger global = getLogger("global"); + public static final Logger global; + + static + { + // Our class might be initialized from an unprivileged context + global = (Logger) AccessController.doPrivileged + (new PrivilegedAction() + { + public Object run() + { + return getLogger("global"); + } + }); + } /** @@ -1194,7 +1209,7 @@ public class Logger /** * Reset and close handlers attached to this logger. This function is package - * private because it must only be avaiable to the LogManager. + * private because it must only be available to the LogManager. */ void resetLogger() { |