Log l = LogFactory.getLog(Debug.class);
if (!(l instanceof LogImpl))
return;
LogImpl log = (LogImpl) l;
String action=request.getParameter("Action");
if ("Set Options".equals(action))
{
log.setDebug("on".equals(request.getParameter("D")));
log.setSuppressWarnings("on".equals(request.getParameter("W")));
String v=request.getParameter("V");
if (v!=null && v.length()>0)
log.setVerbose(Integer.parseInt(v));
else
log.setVerbose(0);
log.setDebugPatterns(request.getParameter("P"));
LogSink[] sinks = log.getLogSinks();
for (int s=0;sinks!=null && s<sinks.length;s++)
{
if (sinks[s]==null)
continue;
if ("on".equals(request.getParameter("LSS"+s)))
{
if(!sinks[s].isStarted())
try{sinks[s].start();}catch(Exception e){log.warn(e);}
}
else
{
if(sinks[s].isStarted())
try{sinks[s].stop();}catch(InterruptedException e){}
}
String options=request.getParameter("LO"+s);
if (options==null)
options="";
if (sinks[s] instanceof OutputStreamLogSink)
{
OutputStreamLogSink sink=(OutputStreamLogSink)sinks[s];
sink.setLogTags("on".equals(request.getParameter("LT"+s)));
sink.setLogLabels ("on".equals(request.getParameter("LL"+s)));
sink.setLogStackSize("on".equals(request.getParameter("Ls"+s)));
sink.setLogStackTrace("on".equals(request.getParameter("LS"+s)));
sink.setSuppressStack("on".equals(request.getParameter("SS"+s)));
sink.setLogOneLine("on".equals(request.getParameter("SL"+s)));
sink.setFilename(request.getParameter("LF"+s));
}
}
}
else if ("Add LogSink".equals(action))
{
System.err.println("add log sink "+request.getParameter("LSC"));
try
{
log.add(request.getParameter("LSC"));
}
catch(Exception e)
{
log.warn(e);
}
}
else if ("Delete Stopped Sinks".equals(action))
{
log.deleteStoppedLogSinks();
}
response.sendRedirect(request.getContextPath()+
request.getServletPath()+"/"+
Long.toString(System.currentTimeMillis(),36)+