normally in file operations, if a specified file missing means it will throw file not found exception. Bu in my case
didnt throw any exception even though there is no log file on the specified name in
getLogger() method. Can anybody answer please?
Best How To :
Since you do not specify the class of 'log', we can only guess here.
I know of no getLogger()-method in log4j that works on a file. The string used there has nothing to do with the name of the log file, it is the name of the logger. If no logger with the given name exists, a new one will be created and returned. A logger does not necessarily care if it has any attached appenders (which might or might not write to a file), so it doesn't care whether any files exist or not.
It is entirely possible and valid to create loggers that do nothing with log-statements.