Show
Ignore:
Timestamp:
07/13/09 14:30:55 (3 years ago)
Author:
amandel
Message:

Catch the situation where a old loggable is held that does not carry the thread name.

Location:
trunk/src/java/org/jcoderz/commons/logging
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/java/org/jcoderz/commons/logging/BasicLogLineFormat.java

    r1507 r1537  
    219219         setBusinessImpact(loggable.getLogMessageInfo().getBusinessImpact()); 
    220220         setCategory(loggable.getLogMessageInfo().getCategory()); 
    221          setThreadName(loggable.getThreadName()); 
     221         try 
     222         { 
     223             setThreadName(loggable.getThreadName()); 
     224         } 
     225         catch (AbstractMethodError ex) 
     226         { 
     227             // We have a old loggable that does not support 
     228             // thread name jet. 
     229             setThreadName(Thread.currentThread().getName()); 
     230         } 
    222231      } 
    223232      else 
  • trunk/src/java/org/jcoderz/commons/logging/LogElement.java

    r1302 r1537  
    167167               Integer.toHexString(mLoggable.getLogMessageInfo().toInt())); 
    168168         setThreadId(mLoggable.getThreadId()); 
    169          setThreadName(mLoggable.getThreadName()); 
     169         try 
     170         { 
     171             setThreadName(mLoggable.getThreadName()); 
     172          } 
     173          catch (AbstractMethodError ex) 
     174          { 
     175              // We have a old loggable that does not support 
     176              // thread name jet. 
     177              setThreadName(Thread.currentThread().getName()); 
     178          } 
     179 
    170180         setTimestamp(Date.fromUtilDate( 
    171181               new java.util.Date(mLoggable.getEventTime())));