I have an AppEngine application with Java. I am using JUL (java.util.logging) to log the server side logs. I am creating a facade call CustomLogger in which it creates a JUL logger in the constructor using the factory:
@Inject
public CustomLogger( EmailLoggingHandler handler ){
this.logger = Logger.getLogger( "ServerLogger" );
logger.addHandler( handler );
}
Instance of CustomLogger is bind as eagerSingleton meaning only one instance of this class will ever be instantiated per Guice instance. Everything was working until I injected the custom logger (EmailLoggingHandler) which is also part of dependency tree as a eagerSingleton.
@Inject
public EmailLoggingHandler( SendEmailHelper emailHelper ){
this.emailHelper = emailHelper;
setLevel(Level.SEVERE);
}
The error I am getting:
Error injecting constructor, java.security.AccessControlException: access denied (java.util.logging.LoggingPermission control)
Does anyone have any idea why this is happening?