Fix logging
This commit is contained in:
parent
1716d8bebe
commit
88ea34e8c0
1 changed files with 7 additions and 7 deletions
|
@ -50,6 +50,7 @@ import net.osmand.swing.OsmExtractionUI;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.apache.commons.logging.impl.Jdk14Logger;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
@ -542,13 +543,12 @@ public class IndexBatchCreator {
|
||||||
try {
|
try {
|
||||||
fh = new FileHandler(new File(workDir, mapFileName+".gen.log").getAbsolutePath(), 5000000, 1, true);
|
fh = new FileHandler(new File(workDir, mapFileName+".gen.log").getAbsolutePath(), 5000000, 1, true);
|
||||||
fh.setFormatter(new SimpleFormatter());
|
fh.setFormatter(new SimpleFormatter());
|
||||||
Logger logger = LogManager.getLogManager().getLogger("batch.file.generation.log");
|
fh.setLevel(Level.ALL);
|
||||||
Handler[] hs = logger.getHandlers();
|
Jdk14Logger jdk14Logger = new Jdk14Logger("tempLogger");
|
||||||
for(int ik=0; ik<hs.length; ik++) {
|
jdk14Logger.getLogger().setLevel(Level.ALL);
|
||||||
logger.removeHandler(hs[ik]);
|
jdk14Logger.getLogger().setUseParentHandlers(false);
|
||||||
}
|
jdk14Logger.getLogger().addHandler(fh);
|
||||||
logger.addHandler(fh);
|
warningsAboutMapData = jdk14Logger;
|
||||||
warningsAboutMapData = LogFactory.getLog("net.osmand.batch.generation.log");
|
|
||||||
} catch (SecurityException e1) {
|
} catch (SecurityException e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
|
|
Loading…
Reference in a new issue