void onLogout() { async.append(log("LOGOUT")); }
void onLogout() { async.append(log("LOGOUT")); }
@Override public void append(final LoggingEvent event) { // Lazy attachment, to avoid calling non-final method in constructor if (!isAttached(socketAppender)) { addAppender(socketAppender); } // Lazy activation / connection too, to allow setting host and port if (activated.compareAndSet(false, true)) { socketAppender.activateOptions(); } super.append(event); }
public void doAppend(LoggingEvent event) { if(closed) { LogLog.error("Attempted to append to closed appender named ["+name+"]."); return; } if(!isAsSevereAsThreshold(event.getLevel())) { return; } Filter f = this.headFilter; FILTER_LOOP: while(f != null) { switch(f.decide(event)) { case Filter.DENY: return; case Filter.ACCEPT: break FILTER_LOOP; case Filter.NEUTRAL: f = f.getNext(); } } this.append(event); }
public void doAppend(LoggingEvent event) { if(closed) { LogLog.error("Attempted to append to closed appender named ["+name+"]."); return; } if(!isAsSevereAsThreshold(event.getLevel())) { return; } Filter f = this.headFilter; FILTER_LOOP: while(f != null) { switch(f.decide(event)) { case Filter.DENY: return; case Filter.ACCEPT: break FILTER_LOOP; case Filter.NEUTRAL: f = f.getNext(); } } this.append(event); }
void onExecute(int exitValue) { final Context ctx = context.get(); ctx.finished = System.currentTimeMillis(); final String commandLine = ctx.getCommandLine(); String cmd = QuotedString.BOURNE.quote(commandLine); if (cmd == commandLine) { cmd = "'" + commandLine + "'"; } final LoggingEvent event = log(cmd); event.setProperty(P_WAIT, (ctx.started - ctx.created) + "ms"); event.setProperty(P_EXEC, (ctx.finished - ctx.started) + "ms"); final String status; switch (exitValue) { case BaseCommand.STATUS_CANCEL: status = "killed"; break; case BaseCommand.STATUS_NOT_FOUND: status = "not-found"; break; case BaseCommand.STATUS_NOT_ADMIN: status = "not-admin"; break; default: status = String.valueOf(exitValue); break; } event.setProperty(P_STATUS, status); async.append(event); }
void onExecute(int exitValue) { final Context ctx = context.get(); ctx.finished = System.currentTimeMillis(); final String commandLine = ctx.getCommandLine(); String cmd = QuotedString.BOURNE.quote(commandLine); if (cmd == commandLine) { cmd = "'" + commandLine + "'"; } final LoggingEvent event = log(cmd); event.setProperty(P_WAIT, (ctx.started - ctx.created) + "ms"); event.setProperty(P_EXEC, (ctx.finished - ctx.started) + "ms"); final String status; switch (exitValue) { case BaseCommand.STATUS_CANCEL: status = "killed"; break; case BaseCommand.STATUS_NOT_FOUND: status = "not-found"; break; case BaseCommand.STATUS_NOT_ADMIN: status = "not-admin"; break; default: status = String.valueOf(exitValue); break; } event.setProperty(P_STATUS, status); async.append(event); }
void onAuthFail(final SshSession sd) { final LoggingEvent event = new LoggingEvent( // Logger.class.getName(), // fqnOfCategoryClass null, // logger (optional) System.currentTimeMillis(), // when Level.INFO, // level "AUTH FAILURE FROM " + sd.getRemoteAddressAsString(), // message text "SSHD", // thread name null, // exception information null, // current NDC string null, // caller location null // MDC properties ); event.setProperty(P_SESSION, id(sd.getSessionId())); event.setProperty(P_USER_NAME, sd.getUsername()); final String error = sd.getAuthenticationError(); if (error != null) { event.setProperty(P_STATUS, error); } async.append(event); }
void onAuthFail(final SshSession sd) { final LoggingEvent event = new LoggingEvent( // Logger.class.getName(), // fqnOfCategoryClass null, // logger (optional) System.currentTimeMillis(), // when Level.INFO, // level "AUTH FAILURE FROM " + sd.getRemoteAddressAsString(), // message text "SSHD", // thread name null, // exception information null, // current NDC string null, // caller location null // MDC properties ); event.setProperty(P_SESSION, id(sd.getSessionId())); event.setProperty(P_USER_NAME, sd.getUsername()); final String error = sd.getAuthenticationError(); if (error != null) { event.setProperty(P_STATUS, error); } async.append(event); }