| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.util.log.Log4jKit
public class Log4jKit
A class to help with log4j related code
| Field Summary | |
|---|---|
| static String | MDC_JIRA_ASSESSION_ID | 
| static String | MDC_JIRA_REQUEST_ID | 
| static String | MDC_JIRA_REQUEST_IPADDR | 
| static String | MDC_JIRA_REQUEST_URL | 
| static String | MDC_JIRA_USERNAME | 
| Constructor Summary | |
|---|---|
| Log4jKit() | |
| Method Summary | |
|---|---|
| static void | clearMDC()This will clear out all the values in the log4j MDC. | 
| static Set<File> | getAllLogFiles() | 
| static File | getLogFileName(String appenderName)Returns the full log file name for the given appender. | 
| static void | putASessionIdToMDC(String atlassianSessionId)This will set the Atlassian Session Id into the log4j MDC | 
| static void | putToMDC(String userName,
         String requestId,
         String asessionId,
         String requestURL,
         String ipAddr)This squirels away request information into the log4j MDC. | 
| static void | putUserToMDC(String userName)This will add the user name to the log4j MDC | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String MDC_JIRA_USERNAME
public static final String MDC_JIRA_REQUEST_ID
public static final String MDC_JIRA_ASSESSION_ID
public static final String MDC_JIRA_REQUEST_URL
public static final String MDC_JIRA_REQUEST_IPADDR
| Constructor Detail | 
|---|
public Log4jKit()
| Method Detail | 
|---|
public static File getLogFileName(String appenderName)
appenderName - the name of the appender in the log4j configuration
public static Set<File> getAllLogFiles()
public static void putToMDC(String userName,
                            String requestId,
                            String asessionId,
                            String requestURL,
                            String ipAddr)
MDC.
userName - the user name in playrequestId - the request idasessionId - the Atlassian Session ID (hash of session id)requestURL - the request URLipAddr - the ipaddress of the clint making the requestpublic static void putUserToMDC(String userName)
MDC
userName - the user name in playpublic static void putASessionIdToMDC(String atlassianSessionId)
MDC
atlassianSessionId - the session id in playpublic static void clearMDC()
MDC. This should be done in a finally
 block perhaps on the outer edge of a request and probably in the start of the request as well.
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||