/** * Get/Put Error Info in String * * @param ctx context * @param errorsOnly if true errors otherwise log * @return error info */ public String getErrorInfo(Properties ctx, boolean errorsOnly) { checkContext(); StringBuffer sb = new StringBuffer(); // if (errorsOnly) { LinkedList<LogRecord[]> m_history = (LinkedList<LogRecord[]>) Env.getCtx().get(HISTORY_KEY); for (int i = 0; i < m_history.size(); i++) { sb.append("-------------------------------\n"); LogRecord[] records = (LogRecord[]) m_history.get(i); for (int j = 0; j < records.length; j++) { LogRecord record = records[j]; sb.append(getFormatter().format(record)); } } } else { LinkedList<LogRecord> m_logs = (LinkedList<LogRecord>) Env.getCtx().get(LOGS_KEY); for (int i = 0; i < m_logs.size(); i++) { LogRecord record = (LogRecord) m_logs.get(i); sb.append(getFormatter().format(record)); } } sb.append("\n"); CLogMgt.getInfo(sb); CLogMgt.getInfoDetail(sb, ctx); // return sb.toString(); } // getErrorInfo