-
Enhancement
-
Resolution: Future Project
-
P4
-
None
-
5.0
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
In java.util.logging handlers publish method should throw a consistent exception if they are unable to log. If they already do so, this exception should be part of the JavaDoc.
JUSTIFICATION :
In situations where logging needs to happen, the system may need to take any/all corrective action to ensure that logging takes place. At my company we are trying to use logging for non-repudiation. If I logging that should occur does not, I will not know that my non-reputable log is incomplete
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Ultimately, all log methods should catch any exception thrown by a handler and throw a logging exception to the calling application. The calling application can suppress the exception or act on it (send an email, write to console, whatever)
I should be able to say
try{
logger.info("this is the log message");
}catch (exception ex){
//send an email or accumulate logging errors or whatever
}
ACTUAL -
logging does not occur
---------- BEGIN SOURCE ----------
//map a drive to z:
//configure a logger
FileHandler myFileHandler = new FileHandler("z:\logs\mytest.log");
Logger logger = Logger.getLogger("mylogger");
logger.setUseParentHandlers(false);
logger.addHandler(myFileHandler );
//disconnect the mapping to drive z:
logger.info("this is the log message");
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I do not know how to bypass this behavior.
In java.util.logging handlers publish method should throw a consistent exception if they are unable to log. If they already do so, this exception should be part of the JavaDoc.
JUSTIFICATION :
In situations where logging needs to happen, the system may need to take any/all corrective action to ensure that logging takes place. At my company we are trying to use logging for non-repudiation. If I logging that should occur does not, I will not know that my non-reputable log is incomplete
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Ultimately, all log methods should catch any exception thrown by a handler and throw a logging exception to the calling application. The calling application can suppress the exception or act on it (send an email, write to console, whatever)
I should be able to say
try{
logger.info("this is the log message");
}catch (exception ex){
//send an email or accumulate logging errors or whatever
}
ACTUAL -
logging does not occur
---------- BEGIN SOURCE ----------
//map a drive to z:
//configure a logger
FileHandler myFileHandler = new FileHandler("z:\logs\mytest.log");
Logger logger = Logger.getLogger("mylogger");
logger.setUseParentHandlers(false);
logger.addHandler(myFileHandler );
//disconnect the mapping to drive z:
logger.info("this is the log message");
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I do not know how to bypass this behavior.