com.atlassian.confluence.admin.actions
Class ConfigureLog4jAction

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.atlassian.confluence.core.ConfluenceActionSupport
          extended by com.atlassian.confluence.admin.actions.ConfigureLog4jAction
All Implemented Interfaces:
WebInterface, MessageHolderAware, com.opensymphony.xwork.Action, com.opensymphony.xwork.LocaleProvider, com.opensymphony.xwork.TextProvider, com.opensymphony.xwork.Validateable, com.opensymphony.xwork.ValidationAware, Serializable

public class ConfigureLog4jAction
extends ConfluenceActionSupport

Allows runtime configuration of Log4j. This class has several entry points:

There are additionally several Hibernate logging related entry points that possibly should be refactored out. This class possibly has too much responsibility at this point, and possibly needs refactoring. It is possible that synchronization errors could occur as the result of switching log levels as a log statement is being generated. TODO: put the logic here into a service or manager layer -- it shouldn't be in an action.

See Also:
Serialized Form

Nested Class Summary
static class ConfigureLog4jAction.LoggingConfigEntry
          Represents a Log4j Config entry, corresponding to a Class or Package mapped to a Level.
 
Field Summary
 
Fields inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
CANCEL, DEVMODE, eventManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, messageHolder, permissionManager, permitted, pluginAccessor, PREVIEW, settingsManager, spacePermissionManager, userAccessor, webInterfaceManager
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ConfigureLog4jAction()
           
 
Method Summary
 String add()
          Add a new entry to the Log4j Configuration.
 String changeProfile()
           
 String changeProfiling()
           
 String delete()
           
 String execute()
           
 List getEntries()
           
 List<String> getLevelTypes()
           
 boolean isHibernateLoggingEnabled()
           
 boolean isPermitted()
           
 boolean isProfilingEnabled()
           
 String save()
           
 void setClassNames(String[] classNames)
           
 void setEntries(List<ConfigureLog4jAction.LoggingConfigEntry> entries)
           
 void setExtraClassName(String extraClassName)
           
 void setExtraLevelName(String extraLevelName)
           
 void setLevelNames(String[] levelNames)
           
 void setProfileName(String profileName)
           
 void setProfilingOn(boolean buttonValue)
           
 void setToDeleteName(String toDeleteName)
           
 String turnOffHibernateLogging()
          Turns off Hibernate Logging (SQL will not be output).
 String turnOnHibernateLogging()
          Turns on Hibernate Logging (both SQL and types will now be output).
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, doDefault, formatFriendlyDate, getActionName, getActionName, getBootstrapManager, getCancelResult, getContext, getDateFormatSetting, getDateFormatter, getDefaultResourceBundle, getDocLink, getEventManager, getFriendlyDateFormatter, getGlobalSettings, getHelper, getI18n, getInstalledLanguages, getLabelManager, getLanguageManager, getLanguageUserFriendly, getLocale, getLocaleManager, getLocaleString, getMessageHolder, getNiceContentType, getPermissionTypes, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPreviousLoginDate, getRandom, getRemoteUser, getSession, getSystemInformationService, getText, getText, getText, getText, getTextStatic, getTextStatic, getTextStrict, getTimeZone, getUser, getUserAccessor, getUserFullName, getUserInterfaceState, getWebInterfaceContext, getWebInterfaceManager, hasPermissionForSpace, isAnonymousUser, isCanceled, isDevMode, isEmailVisible, isExternalUserManagementEnabled, isLabelable, isPermissionCheck, isPermittedAsString, isPrintableVersion, isSharedMode, isUserStatusPluginEnabled, isUsingHSQL, setBootstrapManager, setCancel, setContentUiSupport, setEventManager, setFormatSettingsManager, setI18NBean, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setLoginManager, setMessageHolder, setPermissionCheck, setPermissionManager, setPluginAccessor, setPreviousLoginDate, setSettingsManager, setSpacePermissionManager, setSystemInformationService, setUserAccessor, setWebInterfaceManager
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.validation.MessageHolderAware
validate
 

Constructor Detail

ConfigureLog4jAction

public ConfigureLog4jAction()
Method Detail

execute

public String execute()
Specified by:
execute in interface com.opensymphony.xwork.Action
Overrides:
execute in class com.opensymphony.xwork.ActionSupport

changeProfiling

public String changeProfiling()

setToDeleteName

public void setToDeleteName(String toDeleteName)

setProfilingOn

public void setProfilingOn(boolean buttonValue)

getLevelTypes

public List<String> getLevelTypes()

delete

public String delete()

save

public String save()

add

public String add()
Add a new entry to the Log4j Configuration.

Returns:
action result

getEntries

public List getEntries()

setEntries

public void setEntries(List<ConfigureLog4jAction.LoggingConfigEntry> entries)

setClassNames

public void setClassNames(String[] classNames)

setLevelNames

public void setLevelNames(String[] levelNames)

setExtraClassName

public void setExtraClassName(String extraClassName)

setExtraLevelName

public void setExtraLevelName(String extraLevelName)

turnOnHibernateLogging

public String turnOnHibernateLogging()
Turns on Hibernate Logging (both SQL and types will now be output).

Returns:
action result

turnOffHibernateLogging

public String turnOffHibernateLogging()
Turns off Hibernate Logging (SQL will not be output).

Returns:
action result

isHibernateLoggingEnabled

public boolean isHibernateLoggingEnabled()

setProfileName

public void setProfileName(String profileName)

changeProfile

public String changeProfile()

isProfilingEnabled

public boolean isProfilingEnabled()

isPermitted

public boolean isPermitted()
Overrides:
isPermitted in class ConfluenceActionSupport


Copyright © 2003-2012 Atlassian. All Rights Reserved.