i Wrote code abbreviation code that I want to debug.
to do this, I cannot use standard output because the Hadoop platform does not display it unless an error occurs.
instead, I tried to use a log to create a log file.
i split it into two files using a handler, unfortunately, a “serious” log file leaves empty, and the general log file only logs events that occur in the main stream, and not in the map reduction functions.
The question is:
is there a problem with hadoop and log files or is it a problem with my logger configuration? if so, how to fix it.
log configuration code: I use one logger for the entire application (this is the root time logger)
public static Logger configureLogging()
{
try
{
logger=Logger.getLogger("");
logger.setLevel(Level.ALL);
FileHandler handler=new FileHandler(Misc.LOGS_PATH+"mylog.xml",true);
FileHandler severeHandler=new FileHandler(Misc.LOGS_PATH+"mylogSevere.xml",true);
severeHandler.setLevel(Level.INFO);
logger.addHandler(handler);
logger.addHandler(severeHandler);
}
catch (Exception e)
{
e.printStackTrace();
}
return logger;
}
source
share