|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.util.log.Log4jKit
public class Log4jKit
A class to help with log4j related code
Field Summary | |
---|---|
static java.lang.String |
MDC_JIRA_ASSESSION_ID
|
static java.lang.String |
MDC_JIRA_REQUEST_ID
|
static java.lang.String |
MDC_JIRA_REQUEST_IPADDR
|
static java.lang.String |
MDC_JIRA_REQUEST_URL
|
static java.lang.String |
MDC_JIRA_USERNAME
|
Constructor Summary | |
---|---|
Log4jKit()
|
Method Summary | |
---|---|
static void |
clearMDC()
This will clear out all the values in the log4j MDC . |
static java.util.Set<java.io.File> |
getAllLogFiles()
|
static java.io.File |
getLogFileName(java.lang.String appenderName)
Returns the full log file name for the given appender. |
static void |
putASessionIdToMDC(java.lang.String atlassianSessionId)
This will set the Atlassian Session Id into the log4j MDC |
static void |
putToMDC(java.lang.String userName,
java.lang.String requestId,
java.lang.String asessionId,
java.lang.String requestURL,
java.lang.String ipAddr)
This squirels away request information into the log4j MDC . |
static void |
putUserToMDC(java.lang.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 java.lang.String MDC_JIRA_USERNAME
public static final java.lang.String MDC_JIRA_REQUEST_ID
public static final java.lang.String MDC_JIRA_ASSESSION_ID
public static final java.lang.String MDC_JIRA_REQUEST_URL
public static final java.lang.String MDC_JIRA_REQUEST_IPADDR
Constructor Detail |
---|
public Log4jKit()
Method Detail |
---|
public static java.io.File getLogFileName(java.lang.String appenderName)
appenderName
- the name of the appender in the log4j configuration
public static java.util.Set<java.io.File> getAllLogFiles()
public static void putToMDC(java.lang.String userName, java.lang.String requestId, java.lang.String asessionId, java.lang.String requestURL, java.lang.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(java.lang.String userName)
MDC
userName
- the user name in playpublic static void putASessionIdToMDC(java.lang.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 |