public StatusManager (DB db) { super (); this.db = db; this.syslog = new SysLogManager(db); } /**
/** * Create a SysLogEvent and add it to the DB. * If auto commit is on, then the operation is performed * within a transaction, otherwise, it's up to the user * to commit or flush the session. * @param source this log event source * @param type application specific event type (i.e. INFO, WARN, ERROR, ...) * @param severity either DEBUG, TRACE, INFO, WARN, ERROR or CRITICAL * @param summary summary information * @return the newly created SysLogEvent */ public SysLog log (String source, String type, int severity, String summary) { return log (source, type, severity, summary, null, null); } private void errorLog (SysLog evt, Throwable t) {
public void stopService() { long elapsed = System.currentTimeMillis() - start; new SysLogManager().log (cfg.get ("source", getName()), "SYSTEM", SysLog.INFO, "Stop (uptime " + DateUtil.toDays(elapsed) + ")" ); } }
db.close (); } catch (Throwable t) { errorLog (evt, t);
public void run () { if (getServer().ready(60000L)) { new SysLogManager().log (cfg.get ("source", getName()), "SYSTEM", SysLog.INFO, "Start"); } else { getLog().warn ("Q2 not ready"); } } public void stopService() {
/** * Create a SysLogEvent and add it to the DB. * If auto commit is on, then the operation is performed * within a transaction, otherwise, it's up to the user * to commit or flush the session. * @param source this log event source * @param type application specific event type (i.e. INFO, WARN, ERROR, ...) * @param severity either DEBUG, TRACE, INFO, WARN, ERROR or CRITICAL * @param summary summary information * @param detail optional detail information * @return the newly created SysLogEvent */ public SysLog log (String source, String type, int severity, String summary, String detail) { return log (source, type, severity, summary, detail, null); } /**
sb.append (response); events.add ( syslog.log ( "status:" + status.getId(), "AUDIT", SysLog.INFO,
transition.append (state); events.add ( syslog.log ( "status:" + status.getId(), state, getSysLogSeverity (state),
if (status.getMaxEvents() > 0 || status.getMaxEvents() == -1) { events.add ( syslog.log ( "status:" + status.getId(), state, getSysLogSeverity (timeoutState),