我创建了简单的Java
记录器:
private void createLoggerA(String fileName)
{
try
{
Level logLevel= Level.ALL;
logger = Logger.getLogger("LOGGER");
logger.setUseParentHandlers(false);
logger.setLevel(logLevel);
makeDirs(fileName);
LogFormatterA lf = new LogFormatterA();
File f=new File(fileName);
FileHandler fh = new FileHandler(f.getAbsolutePath());
fh.setFormatter(lf);
fh.setLevel(logLevel);
logger.addHandler(fh);
ConsoleHandler ch = new ConsoleHandler();
ch.setFormatter(lf);
ch.setLevel(logLevel);
logger.addHandler(ch);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
如果我记录:
l.fine("bla bla");
in outpuut我有:
2016.03.21 12:28:35.641 1 . FINE: bla bla
日期和. FINE
之间的数字1表示什么:
... 641 1 。 FINE ...