Package org.fao.geonet

Examples of org.fao.geonet.Logger


            String logfile = initializeLog();
            this.log.info("Starting harvesting of " + this.getParams().name);
            error = null;
            errors.clear();
            final Logger logger = this.log;
            final String nodeName = getParams().name + " (" + getClass().getSimpleName() + ")";
            final String lastRun = new DateTime().withZone(DateTimeZone.forID("UTC")).toString();
            try {
                login();

                //--- update lastRun
                settingMan.setValue("harvesting/id:" + id + "/info/lastRun", lastRun);

                //--- proper harvesting
                logger.info("Started harvesting from node : " + nodeName);
                HarvestWithIndexProcessor h = new HarvestWithIndexProcessor(dataMan, logger);
                // todo check (was: processwithfastindexing)
                h.process();
                logger.info("Ended harvesting from node : " + nodeName);

                if (getParams().oneRunOnly) {
                    stop();
                }
            } catch (InvalidParameterValueEx e) {
                logger.error("The harvester " + this.getParams().name + "["
                             + this.getType()
                             + "] didn't accept some of the parameters sent.");

                errors.add(new HarvestError(e, logger));
                error = e;
                operResult = OperResult.ERROR;
            } catch (Throwable t) {
                operResult = OperResult.ERROR;
                logger.warning("Raised exception while harvesting from : " + nodeName);
                logger.warning(" (C) Class   : " + t.getClass().getSimpleName());
                logger.warning(" (C) Message : " + t.getMessage());
                error = t;
                t.printStackTrace();
                errors.add(new HarvestError(t, logger));
            } finally {
                List<HarvestError> harvesterErrors = getErrors();
View Full Code Here


   * Read the input MEF file and for each metadata found, check structure for
   * metadata.xml, info.xml and optional feature catalogue files.
   */
  public Element handleXml(File mefFile, IMEFVisitor v) throws Exception {

    Logger log = Log.createLogger(Geonet.MEF);

    int nbMetadata = 0;
    Element fc;

    Element info = new Element("info");

    File unzipDir = new File(mefFile.getParentFile(), "unzipping");

    if (unzipDir.exists())
            FileCopyMgr.removeDirectoryOrFile(unzipDir);

    ZipUtil.extract(new ZipFile(mefFile), unzipDir);

    // Get the metadata depth
    File metadata = getMetadataDirectory(unzipDir);

    if (metadata.getParentFile().equals(unzipDir)) {
      log
          .debug("Metadata folder is directly under the unzip temporary folder.");
    } else {
      File[] lstmdDir = metadata.getParentFile().getParentFile()
          .listFiles();
            for (File file : lstmdDir) {
View Full Code Here

        .getMandatoryValue(Geonet.Config.LUCENE_CONFIG);

    LuceneConfig lc = context.getBean(LuceneConfig.class);
        lc.configure(luceneConfigXmlFile);

    Logger logger = context.getLogger();
    logger.info("  - Lucene configuration is:");
    String config = lc.toString();
    logger.info(config);

    return new Element("response")
      .addContent(new Element("status").setText(status))
      .addContent(new Element("config").setText(config));
  }
View Full Code Here

TOP

Related Classes of org.fao.geonet.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.