Writes the given error to the report,
and, if enabled, to the opencms log file.<p>

@param report the report to write to
@param e the exception
555114
private void writeError(I_CmsReport report, Throwable e) {

        report.println(e);
        if (LOG.isWarnEnabled()) {
            LOG.warn("SQLConsole", e);
        }
    }
940637
public void startContentCheck(CmsObject cms, I_CmsReport report) throws Exception {

        m_report = report;
        m_report.println(Messages.get().container(Messages.RPT_CONTENT_CHECK_BEGIN_0), I_CmsReport.FORMAT_HEADLINE);

        // collect all resources
        m_report.print(Messages.get().container(Messages.RPT_CONTENT_COLLECT_BEGIN_0), I_CmsReport.FORMAT_HEADLINE);
        m_report.println(
            org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
            I_CmsReport.FORMAT_HEADLINE);
        m_resources = collectResources(cms);
        m_report.print(
            org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
            I_CmsReport.FORMAT_HEADLINE);
        m_report.println(
            Messages.get().container(Messages.RPT_CONTENT_COLLECT_END_1, new Integer(m_resources.size())),
            I_CmsReport.FORMAT_HEADLINE);

        // now process all resources
        m_report.print(Messages.get().container(Messages.RPT_CONTENT_PROCESS_BEGIN_0), I_CmsReport.FORMAT_HEADLINE);
        m_report.println(
            org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
            I_CmsReport.FORMAT_HEADLINE);
        int count = 1;
        Iterator i = m_resources.keySet().iterator();
        while (i.hasNext()) {
            String resourceName = (String)i.next();
            CmsContentCheckResource res = (CmsContentCheckResource)m_resources.get(resourceName);
            boolean errorWarning = false;
            m_report.print(
                Messages.get().container(
                    Messages.RPT_CONTENT_PROCESS_2,
                    new Integer(count++),
                    new Integer(m_resources.size())),
                I_CmsReport.FORMAT_NOTE);
            m_report.print(
                Messages.get().container(Messages.RPT_CONTENT_PROCESS_RESOURCE_1, res.getResourceName()),
                I_CmsReport.FORMAT_DEFAULT);
            m_report.print(
                org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
                I_CmsReport.FORMAT_NOTE);

            // loop through all plugins and perform each content check
            Iterator j = getPlugins().iterator();
            while (j.hasNext()) {
                I_CmsContentCheck plugin = (I_CmsContentCheck)j.next();
                if (plugin.isActive()) {
                    try {
                        // process the content check
                        res = plugin.executeContentCheck(m_cms, res);

                    } catch (CmsException e) {
                        errorWarning = true;
                        m_report.println(Messages.get().container(Messages.RPT_EMPTY_0), I_CmsReport.FORMAT_DEFAULT);
                        m_report.print(
                            Messages.get().container(Messages.RPT_CONTENT_PROCESS_ERROR_2, plugin.getName(), e),
                            I_CmsReport.FORMAT_ERROR);
                    }
                }
            }

            // check if there are some errors
            List errors = res.getErrors();
            if ((errors != null) && (errors.size() > 0)) {
                errorWarning = true;
                m_report.println(Messages.get().container(Messages.RPT_EMPTY_0), I_CmsReport.FORMAT_DEFAULT);
                m_report.println(
                    Messages.get().container(Messages.RPT_CONTENT_PROCESS_ERROR_0),
                    I_CmsReport.FORMAT_ERROR);
                Iterator k = errors.iterator();
                while (k.hasNext()) {
                    String error = (String)k.next();
                    m_report.println(
                        Messages.get().container(Messages.RPT_CONTENT_PROCESS_ERROR_1, error),
                        I_CmsReport.FORMAT_ERROR);

                }
            }

            // check if there are some warnings
            List warnings = res.getWarnings();
            if ((warnings != null) && (warnings.size() > 0)) {
                errorWarning = true;
                m_report.println(Messages.get().container(Messages.RPT_EMPTY_0), I_CmsReport.FORMAT_DEFAULT);
                m_report.println(
                    Messages.get().container(Messages.RPT_CONTENT_PROCESS_WARNING_0),
                    I_CmsReport.FORMAT_WARNING);
                Iterator k = warnings.iterator();
                while (k.hasNext()) {
                    String warning = (String)k.next();
                    m_report.println(
                        Messages.get().container(Messages.RPT_CONTENT_PROCESS_WARNING_1, warning),
                        I_CmsReport.FORMAT_WARNING);

                }
            }

            // store the updated CmsContentCheckResource
            m_resources.put(resourceName, res);

            if (!errorWarning) {
                m_report.println(
                    org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                    I_CmsReport.FORMAT_OK);
            } else {
                // there was an error or warning, so store the CmsContentCheckResource
                // in the results
                m_result.addResult(res);
            }
        }
        m_report.print(
            org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
            I_CmsReport.FORMAT_HEADLINE);
        m_report.println(Messages.get().container(Messages.RPT_CONTENT_PROCESS_END_0), I_CmsReport.FORMAT_HEADLINE);

        m_report.println(Messages.get().container(Messages.RPT_CONTENT_CHECK_END_0), I_CmsReport.FORMAT_HEADLINE);
    }
1337063
private void report(I_CmsReport report, int counter, int resCount, CmsResource resource) {

        // report entries
        report.print(
            org.opencms.report.Messages.get().container(
                org.opencms.report.Messages.RPT_SUCCESSION_2,
                String.valueOf(counter),
                String.valueOf(resCount)),
            I_CmsReport.FORMAT_NOTE);
        report.print(
            org.opencms.report.Messages.get().container(
                org.opencms.report.Messages.RPT_ARGUMENT_1,
                report.removeSiteRoot(resource.getRootPath())));
        report.print(
            org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
            I_CmsReport.FORMAT_DEFAULT);
    }
99302
public void error(Throwable error, String description) {
    log(error, null, description, Level.ERROR);
  }
444215
public function report($e)
    {
        if ($e instanceof Throwable) {
            $e = $this->throwableToException($e);
        }
        
        if ($this->shouldntReport($e)) {
            return;
        }
        
        app('Psr\Log\LoggerInterface')->error((string) $e);
    }
1036335
public static void saveReport(Report report, String path) {
		FileOutputStream fos = null;
		try {
			fos = new FileOutputStream(path);
			saveReport(report, fos);
		} catch (Exception ex) {
			LOG.error(ex.getMessage(), ex);
			ex.printStackTrace();
		} finally {
			if (fos != null) {
				try {
					fos.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
187977
@Override
    public void onWriteError(Exception e, List<? extends ContentItem> items) {
        StringBuilder sb = new StringBuilder();
        for (ContentItem item : items) {
            sb.append(item.getContentId() + ", ");
        }

        String message = "Error writing item(s): " + e.getMessage() + ": items=" + sb.toString();
        this.errors.add(message);
        log.error(message, e);
    }
937869
@Requires("r != null")
  public void report(Report r) {
    if (r.getKind() == Kind.ERROR) {
      ++errorCount;
    }
    reports.add(r);
  }
1337716
public void actionReport() throws JspException {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
        switch (getAction()) {
            case ACTION_REPORT_END:
                actionCloseDialog();
                break;
            case ACTION_REPORT_UPDATE:
                setParamAction(REPORT_UPDATE);
                getJsp().include(FILE_REPORT_OUTPUT);
                break;
            case ACTION_REPORT_BEGIN:
            case ACTION_CONFIRMED:
            default:
                CmsExternalLinksValidatorThread thread = new CmsExternalLinksValidatorThread(getCms(), null);
                thread.start();
                setParamAction(REPORT_BEGIN);
                setParamThread(thread.getUUID().toString());
                Map params = new HashMap(1);
                params.put(PARAM_CLOSELINK, CmsToolManager.linkForToolPath(getJsp(), "/linkchecking"));
                getJsp().include(FILE_REPORT_OUTPUT, null, params);
                break;
        }
    }
589741
public void error(Throwable error, String format, Object... extra) {
    if (shouldLog(INFO)) {
      Log.e(tag, String.format(format, extra), error);
    }
  }
1073049
public static void setConfigException(Throwable e)
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        EnvironmentClassLoader envLoader = (EnvironmentClassLoader) loader;

        envLoader.setConfigException(e);

        return;
      }
    }
  }
639312
public static void reportEndImport(I_CmsReport report) {

        report.println(Messages.get().container(Messages.RPT_IMPORT_MODULE_END_0), I_CmsReport.FORMAT_HEADLINE);
    }
1154424
public void setConfigException(Exception e)
  {
    log.log(Level.FINER, e.toString(), e);
  }
876053
public void logError(final Level level, final String message, final Error e)
	{
		try {
			Logger errors = LoggingFactory
					.getLogger(LoggingFactory.NAME_ERROR_LOGGER);

			errors.logThrowable(level, message, e);

		}
		catch (LoggingException ex) {
			ex.printStackTrace();
		}

		if (logLevel.toInt() > level.toInt()) {
			return;
		}

		logThrowable(level, message, e);
	}
677029
public void setReport(Report report) {
		this.report = report;
		if (this.report.getQuery() != null) {
			this.report.getQuery().setDialect(dialect);
		}
	}
531365
public void error(CharSequence message, Throwable e) {
    log(Level.SEVERE, message, e);
  }
1294549
public void onError(Exception e) {
    LOG.log(Level.SEVERE, e.getMessage(), e);
  }