Hi,
we already output the thread id...:
Code:
StringBuffer result = new StringBuffer();
m_cal.setTimeInMillis(record.getMillis());
result.append(m_cal.get(Calendar.YEAR));
result.append(":");
result.append(fv((m_cal.get(Calendar.MONTH)+1)+"",2));
result.append(":");
result.append(fv(m_cal.get(Calendar.DAY_OF_MONTH)+"",2));
result.append(" ");
result.append(fv(m_cal.get(Calendar.HOUR_OF_DAY)+"",2));
result.append(":");
result.append(fv(m_cal.get(Calendar.MINUTE)+"",2));
result.append(":");
result.append(fv(m_cal.get(Calendar.SECOND)+"",2));
result.append(":");
result.append(fv(m_cal.get(Calendar.MILLISECOND)+"",3));
result.append(" | ");
result.append(fs(record.getThreadID()+"",6));
result.append(" | ");
result.append(fs(record.getLevel()+"",8));
result.append(" | ");
result.append(record.getMessage());
if (s_outputclassmethod == true)
{
result.append(" .......... ");
result.append(record.getSourceClassName());
result.append(">");
result.append(record.getSourceMethodName());
}
result.append("\n");
if (record.getThrown() != null)
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter pw = new PrintWriter(baos);
record.getThrown().printStackTrace(pw);
pw.flush();
result.append(".......... Stacktrace Info ..........\n");
result.append(baos.toString());
}
return result.toString();
Adding the session id is a bigger problem, we would have to update all our logging statements.
If this is a problem: you may write a Filter (servlet filter), that at the very beginning set the thread id to the session id. You may use this filter for testing purposes only (changing the thread id is typically not really "polite"...).
Björn