diff --git a/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java b/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java index 369b0daa9a0..f29567a1b8c 100644 --- a/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java +++ b/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java @@ -38,6 +38,7 @@ import teammates.lnp.util.LNPSpecification; import teammates.lnp.util.LNPTestData; import teammates.lnp.util.TestProperties; +import teammates.main.Application; import teammates.test.BaseTestCase; import teammates.test.FileHelper; @@ -51,7 +52,7 @@ public abstract class BaseLNPTestCase extends BaseTestCase { static final String PUT = HttpPut.METHOD_NAME; static final String DELETE = HttpDelete.METHOD_NAME; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final int RESULT_COUNT = 3; diff --git a/src/lnp/java/teammates/lnp/sql/BaseLNPTestCase.java b/src/lnp/java/teammates/lnp/sql/BaseLNPTestCase.java index 94cb0eb698b..1c2dca0bdb5 100644 --- a/src/lnp/java/teammates/lnp/sql/BaseLNPTestCase.java +++ b/src/lnp/java/teammates/lnp/sql/BaseLNPTestCase.java @@ -39,6 +39,7 @@ import teammates.lnp.util.LNPSpecification; import teammates.lnp.util.LNPSqlTestData; import teammates.lnp.util.TestProperties; +import teammates.main.Application; import teammates.test.BaseTestCase; import teammates.test.FileHelper; @@ -52,7 +53,7 @@ public abstract class BaseLNPTestCase extends BaseTestCase { static final String PUT = HttpPut.METHOD_NAME; static final String DELETE = HttpDelete.METHOD_NAME; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final int RESULT_COUNT = 3; diff --git a/src/main/java/teammates/common/datatransfer/TeamEvalResult.java b/src/main/java/teammates/common/datatransfer/TeamEvalResult.java index 8d3358f7690..e225d43eec4 100644 --- a/src/main/java/teammates/common/datatransfer/TeamEvalResult.java +++ b/src/main/java/teammates/common/datatransfer/TeamEvalResult.java @@ -5,6 +5,7 @@ import teammates.common.util.Const; import teammates.common.util.Logger; import teammates.common.util.StringHelper; +import teammates.main.Application; /** * This class represents an feedback contribution question result for a given team. @@ -18,7 +19,7 @@ public class TeamEvalResult { public static final int NSU = Const.POINTS_NOT_SURE; /** did Not SuBmit. */ public static final int NSB = Const.POINTS_NOT_SUBMITTED; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); /** submission values originally from students of the team. */ public int[][] claimed; diff --git a/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java index 13c13b52cf2..dab6efbd646 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java @@ -12,6 +12,7 @@ import teammates.common.util.FieldValidator; import teammates.common.util.Logger; import teammates.common.util.SanitizationHelper; +import teammates.main.Application; import teammates.storage.entity.Course; /** @@ -19,7 +20,7 @@ */ public final class CourseAttributes extends EntityAttributes implements Comparable { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private Instant createdAt; private Instant deletedAt; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java index 639d89aaf8c..a5a79f3359c 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java @@ -20,6 +20,7 @@ import teammates.common.util.Const; import teammates.common.util.JsonUtils; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackQuestion; /** @@ -43,7 +44,7 @@ public class FeedbackContributionQuestionDetails extends FeedbackQuestionDetails private static final int SUMMARY_INDEX_CLAIMED = 0; private static final int SUMMARY_INDEX_PERCEIVED = 1; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private boolean isZeroSum; private boolean isNotSureAllowed; diff --git a/src/main/java/teammates/common/util/Config.java b/src/main/java/teammates/common/util/Config.java index 4ec6f7971b8..6ed06fcf726 100644 --- a/src/main/java/teammates/common/util/Config.java +++ b/src/main/java/teammates/common/util/Config.java @@ -1,11 +1,15 @@ package teammates.common.util; +import teammates.main.Application; + import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Properties; +import java.util.logging.Logger; + /** * Represents the deployment-specific configuration values of the system. @@ -126,14 +130,20 @@ public final class Config { /** Indicates whether the current server is dev server. */ public static final boolean IS_DEV_SERVER; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Config.class.getName()); + + private static final String PROPERTIES_FILE_NAME = "build.template.properties"; static { Properties properties = new Properties(); - try (InputStream buildPropStream = FileHelper.getResourceAsStream("build.properties")) { - properties.load(buildPropStream); + try (InputStream buildPropStream = FileHelper.getResourceAsStream(PROPERTIES_FILE_NAME)) { + if (buildPropStream != null) { + properties.load(buildPropStream); + } else { + throw new RuntimeException(PROPERTIES_FILE_NAME + " file not found"); + } } catch (IOException e) { - assert false; + throw new RuntimeException("Failed to load properties from " + PROPERTIES_FILE_NAME, e); } String appVersion = properties.getProperty("app.version"); diff --git a/src/main/java/teammates/common/util/Logger.java b/src/main/java/teammates/common/util/Logger.java index c48061cd670..8261926a2d8 100644 --- a/src/main/java/teammates/common/util/Logger.java +++ b/src/main/java/teammates/common/util/Logger.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.logging.Level; import jakarta.servlet.http.HttpServletRequest; @@ -19,6 +20,7 @@ import teammates.common.datatransfer.logs.RequestLogDetails; import teammates.common.datatransfer.logs.RequestLogUser; import teammates.common.datatransfer.logs.SourceLocation; +import teammates.main.Application; /** * Allows any component of the application to log messages at appropriate levels. @@ -39,10 +41,14 @@ private Logger() { this.errorLog = java.util.logging.Logger.getLogger(loggerName + "-err"); } - public static Logger getLogger() { + public static Logger getLogger(Class applicationClass) { return new Logger(); } + public static Logger getLogger(String name) { + return null; + } + /** * Logs a message at FINE level. */ @@ -335,4 +341,6 @@ private StackTraceElement getLoggerSource() { return null; } + public void log(Level severe, String failedToStartTheServer, Exception e) { + } } diff --git a/src/main/java/teammates/common/util/StringHelper.java b/src/main/java/teammates/common/util/StringHelper.java index 653b52a7d9a..f22bcecffef 100644 --- a/src/main/java/teammates/common/util/StringHelper.java +++ b/src/main/java/teammates/common/util/StringHelper.java @@ -17,13 +17,14 @@ import com.google.common.base.CharMatcher; import teammates.common.exception.InvalidParametersException; +import teammates.main.Application; /** * Holds String-related helper functions. */ public final class StringHelper { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private StringHelper() { // utility class diff --git a/src/main/java/teammates/logic/api/EmailSender.java b/src/main/java/teammates/logic/api/EmailSender.java index 253985c0575..c90c2025222 100644 --- a/src/main/java/teammates/logic/api/EmailSender.java +++ b/src/main/java/teammates/logic/api/EmailSender.java @@ -14,13 +14,14 @@ import teammates.logic.external.MailgunService; import teammates.logic.external.MailjetService; import teammates.logic.external.SendgridService; +import teammates.main.Application; /** * Handles operations related to sending emails. */ public class EmailSender { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final EmailSender instance = new EmailSender(); private final EmailSenderService service; diff --git a/src/main/java/teammates/logic/api/TaskQueuer.java b/src/main/java/teammates/logic/api/TaskQueuer.java index 6d7e9acdbeb..5b912f02162 100644 --- a/src/main/java/teammates/logic/api/TaskQueuer.java +++ b/src/main/java/teammates/logic/api/TaskQueuer.java @@ -13,6 +13,7 @@ import teammates.logic.external.GoogleCloudTasksService; import teammates.logic.external.LocalTaskQueueService; import teammates.logic.external.TaskQueueService; +import teammates.main.Application; import teammates.ui.request.FeedbackSessionRemindRequest; import teammates.ui.request.SendEmailRequest; @@ -21,7 +22,7 @@ */ public class TaskQueuer { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final TaskQueuer instance = new TaskQueuer(); private final TaskQueueService service; diff --git a/src/main/java/teammates/logic/core/CoursesLogic.java b/src/main/java/teammates/logic/core/CoursesLogic.java index 7679b4e9f90..490fe229497 100644 --- a/src/main/java/teammates/logic/core/CoursesLogic.java +++ b/src/main/java/teammates/logic/core/CoursesLogic.java @@ -17,6 +17,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.api.CoursesDb; import teammates.storage.sqlentity.Account; @@ -28,7 +29,7 @@ */ public final class CoursesLogic { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final CoursesLogic instance = new CoursesLogic(); diff --git a/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java b/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java index 4e751fd5f25..048b9435538 100644 --- a/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java @@ -26,6 +26,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.api.FeedbackQuestionsDb; /** @@ -38,7 +39,7 @@ public final class FeedbackQuestionsLogic { static final String USER_NAME_FOR_SELF = "Myself"; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final FeedbackQuestionsLogic instance = new FeedbackQuestionsLogic(); diff --git a/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java b/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java index 3772955a15d..d2b5d2230ad 100644 --- a/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java @@ -19,6 +19,7 @@ import teammates.common.util.Const; import teammates.common.util.Logger; import teammates.common.util.TimeHelper; +import teammates.main.Application; import teammates.storage.api.FeedbackSessionsDb; /** @@ -29,7 +30,7 @@ */ public final class FeedbackSessionsLogic { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final String ERROR_NON_EXISTENT_FS_STRING_FORMAT = "Trying to %s a non-existent feedback session: "; private static final String ERROR_NON_EXISTENT_FS_UPDATE = String.format(ERROR_NON_EXISTENT_FS_STRING_FORMAT, "update"); diff --git a/src/main/java/teammates/logic/core/InstructorsLogic.java b/src/main/java/teammates/logic/core/InstructorsLogic.java index 0af7387f933..7d17db6dd51 100644 --- a/src/main/java/teammates/logic/core/InstructorsLogic.java +++ b/src/main/java/teammates/logic/core/InstructorsLogic.java @@ -18,6 +18,7 @@ import teammates.common.exception.SearchServiceException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.api.InstructorsDb; /** @@ -28,7 +29,7 @@ */ public final class InstructorsLogic { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final InstructorsLogic instance = new InstructorsLogic(); diff --git a/src/main/java/teammates/logic/core/LogicStarter.java b/src/main/java/teammates/logic/core/LogicStarter.java index a3db4ad2ff3..4de5c1b6060 100644 --- a/src/main/java/teammates/logic/core/LogicStarter.java +++ b/src/main/java/teammates/logic/core/LogicStarter.java @@ -4,13 +4,14 @@ import jakarta.servlet.ServletContextListener; import teammates.common.util.Logger; +import teammates.main.Application; /** * Setup in web.xml to register logic classes at application startup. */ public class LogicStarter implements ServletContextListener { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); /** * Registers dependencies between different logic classes. diff --git a/src/main/java/teammates/logic/external/FirebaseAuthService.java b/src/main/java/teammates/logic/external/FirebaseAuthService.java index 2d558ade7b4..ae566bed223 100644 --- a/src/main/java/teammates/logic/external/FirebaseAuthService.java +++ b/src/main/java/teammates/logic/external/FirebaseAuthService.java @@ -13,6 +13,7 @@ import teammates.common.exception.AuthException; import teammates.common.util.FileHelper; import teammates.common.util.Logger; +import teammates.main.Application; /** * Provides Firebase Admin Auth authentication services. @@ -21,7 +22,7 @@ */ public class FirebaseAuthService implements AuthService { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); public FirebaseAuthService() throws AuthException { try { diff --git a/src/main/java/teammates/logic/external/GoogleCloudTasksService.java b/src/main/java/teammates/logic/external/GoogleCloudTasksService.java index 89e1f52fbec..5b76a916679 100644 --- a/src/main/java/teammates/logic/external/GoogleCloudTasksService.java +++ b/src/main/java/teammates/logic/external/GoogleCloudTasksService.java @@ -18,13 +18,14 @@ import teammates.common.util.JsonUtils; import teammates.common.util.Logger; import teammates.common.util.TaskWrapper; +import teammates.main.Application; /** * Holds functions for operations related to Google Cloud Tasks. */ public class GoogleCloudTasksService implements TaskQueueService { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void addDeferredTask(TaskWrapper task, long countdownTime) { diff --git a/src/main/java/teammates/logic/external/GoogleRecaptchaService.java b/src/main/java/teammates/logic/external/GoogleRecaptchaService.java index 3b1f591f95f..0624b2dc2d5 100644 --- a/src/main/java/teammates/logic/external/GoogleRecaptchaService.java +++ b/src/main/java/teammates/logic/external/GoogleRecaptchaService.java @@ -11,6 +11,7 @@ import teammates.common.util.HttpRequest; import teammates.common.util.JsonUtils; import teammates.common.util.Logger; +import teammates.main.Application; /** * Google-based reCAPTCHA verifier service. @@ -22,7 +23,7 @@ public class GoogleRecaptchaService implements RecaptchaService { /** The Google reCAPTCHA API URL to verify the response token. */ private static final String VERIFY_URL = "https://www.google.com/recaptcha/api/siteverify"; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private final String secretKey; diff --git a/src/main/java/teammates/logic/external/LocalTaskQueueService.java b/src/main/java/teammates/logic/external/LocalTaskQueueService.java index 891c7fa72a0..d66d95891ab 100644 --- a/src/main/java/teammates/logic/external/LocalTaskQueueService.java +++ b/src/main/java/teammates/logic/external/LocalTaskQueueService.java @@ -20,13 +20,14 @@ import teammates.common.util.JsonUtils; import teammates.common.util.Logger; import teammates.common.util.TaskWrapper; +import teammates.main.Application; /** * Holds functions for operations related to task queue in local dev environment. */ public class LocalTaskQueueService implements TaskQueueService { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void addDeferredTask(TaskWrapper task, long countdownTime) { diff --git a/src/main/java/teammates/logic/external/MailgunService.java b/src/main/java/teammates/logic/external/MailgunService.java index 4256b64975d..9c13feedbed 100644 --- a/src/main/java/teammates/logic/external/MailgunService.java +++ b/src/main/java/teammates/logic/external/MailgunService.java @@ -16,6 +16,7 @@ import teammates.common.util.EmailSendingStatus; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; /** * Email sender service provided by Mailgun. @@ -25,7 +26,7 @@ */ public class MailgunService implements EmailSenderService { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); /** * {@inheritDoc} diff --git a/src/main/java/teammates/main/Application.java b/src/main/java/teammates/main/Application.java index ebca9447363..2a88c9b4f6f 100644 --- a/src/main/java/teammates/main/Application.java +++ b/src/main/java/teammates/main/Application.java @@ -1,13 +1,18 @@ package teammates.main; import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Paths; import java.time.zone.ZoneRulesProvider; +import java.util.logging.Level; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.webapp.WebAppContext; +import org.jetbrains.annotations.NotNull; import teammates.common.util.Config; import teammates.common.util.Logger; import teammates.ui.servlets.DevServerLoginServlet; @@ -20,38 +25,64 @@ // CHECKSTYLE.OFF:UncommentedMain this is the entrypoint class public final class Application { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); + private static final String JETTY_LOG_LEVEL_PROPERTY = "org.eclipse.jetty.LEVEL"; + private static final String INFO = "INFO"; private Application() { // prevent initialization } @SuppressWarnings("PMD.SignatureDeclareThrowsException") // ok to ignore as this is a startup method - public static void main(String[] args) throws Exception { - System.setProperty("org.eclipse.jetty.LEVEL", "INFO"); + public static void main(String[] args) { + try { + System.setProperty(JETTY_LOG_LEVEL_PROPERTY, INFO); - Server server = new Server(Config.getPort()); + final int port = Config.getPort(); + Server server = new Server(port); - WebAppContext webapp = new WebAppContext(); + final WebAppContext webapp = getWebAppContext(); + + server.setHandler(webapp); + server.setStopAtShutdown(true); + server.addEventListener(createLifeCycleListener()); + + server.start(); + server.join(); + } catch (URISyntaxException | IOException e) { + log.log(Level.SEVERE, "Failed to determine WAR path", e); + } catch (Exception e) { + log.log(Level.SEVERE, "Failed to start the server", e); + } + } + + private static WebAppContext getWebAppContext() throws URISyntaxException, IOException { + final WebAppContext webapp = new WebAppContext(); webapp.setContextPath("/"); - String classPath = Application.class.getProtectionDomain().getCodeSource().getLocation().getFile(); - String warPath = new File(classPath).getParentFile().getParentFile().getAbsolutePath(); + + final String warPath = Application.getWarPath(); webapp.setWar(warPath); if (Config.isDevServerLoginEnabled()) { // For dev server, we dynamically add servlet to serve the dev server login page. - - ServletHolder devServerLoginServlet = - new ServletHolder("DevServerLoginServlet", new DevServerLoginServlet()); + ServletHolder devServerLoginServlet = new ServletHolder("DevServerLoginServlet", new DevServerLoginServlet()); webapp.addServlet(devServerLoginServlet, "/devServerLogin"); } + return webapp; + } + private static String getWarPath() throws URISyntaxException, IOException { + return Paths.get(Application.class.getProtectionDomain().getCodeSource().getLocation().toURI()) + .getParent().getParent().toString(); + } - LifeCycle.Listener customLifeCycleListener = new LifeCycle.Listener() { + private static LifeCycle.Listener createLifeCycleListener() { + return new LifeCycle.Listener() { @Override public void lifeCycleStarting(LifeCycle event) { log.startup(); } + @Override public void lifeCycleStarted(LifeCycle event) { log.info("Using zone rules version " + ZoneRulesProvider.getVersions("UTC").firstKey()); @@ -59,7 +90,7 @@ public void lifeCycleStarted(LifeCycle event) { @Override public void lifeCycleFailure(LifeCycle event, Throwable cause) { - log.severe("Instance failed to start/stop: " + Config.getInstanceId()); + log.log(Level.SEVERE, "Instance failed to start/stop: " + Config.getInstanceId(), new Exception(cause)); } @Override @@ -72,16 +103,6 @@ public void lifeCycleStopped(LifeCycle event) { // do nothing } }; - - server.setHandler(webapp); - server.setStopAtShutdown(true); - server.addEventListener(customLifeCycleListener); - - server.start(); - - // By using the server.join() the server thread will join with the current thread. - // See https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#join-- for more details. - server.join(); } - } + diff --git a/src/main/java/teammates/sqllogic/core/FeedbackQuestionsLogic.java b/src/main/java/teammates/sqllogic/core/FeedbackQuestionsLogic.java index 88923417d7d..3a1980df19e 100644 --- a/src/main/java/teammates/sqllogic/core/FeedbackQuestionsLogic.java +++ b/src/main/java/teammates/sqllogic/core/FeedbackQuestionsLogic.java @@ -24,6 +24,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlapi.FeedbackQuestionsDb; import teammates.storage.sqlentity.FeedbackQuestion; import teammates.storage.sqlentity.FeedbackSession; @@ -43,7 +44,7 @@ public final class FeedbackQuestionsLogic { static final String USER_NAME_FOR_SELF = "Myself"; - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final FeedbackQuestionsLogic instance = new FeedbackQuestionsLogic(); private FeedbackQuestionsDb fqDb; diff --git a/src/main/java/teammates/sqllogic/core/FeedbackSessionLogsLogic.java b/src/main/java/teammates/sqllogic/core/FeedbackSessionLogsLogic.java index 8ea0c4f3fe5..5d4ec9d75e8 100644 --- a/src/main/java/teammates/sqllogic/core/FeedbackSessionLogsLogic.java +++ b/src/main/java/teammates/sqllogic/core/FeedbackSessionLogsLogic.java @@ -7,6 +7,7 @@ import org.hibernate.ObjectNotFoundException; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlapi.FeedbackSessionLogsDb; import teammates.storage.sqlentity.FeedbackSessionLog; @@ -18,7 +19,7 @@ */ public final class FeedbackSessionLogsLogic { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final FeedbackSessionLogsLogic instance = new FeedbackSessionLogsLogic(); diff --git a/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java b/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java index b634d441e6a..89e95d9381c 100644 --- a/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java +++ b/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java @@ -15,6 +15,7 @@ import teammates.common.util.Const; import teammates.common.util.Logger; import teammates.common.util.TimeHelper; +import teammates.main.Application; import teammates.storage.sqlapi.FeedbackSessionsDb; import teammates.storage.sqlentity.FeedbackQuestion; import teammates.storage.sqlentity.FeedbackSession; @@ -28,7 +29,7 @@ */ public final class FeedbackSessionsLogic { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final String ERROR_NON_EXISTENT_FS_STRING_FORMAT = "Trying to %s a non-existent feedback session: "; private static final String ERROR_NON_EXISTENT_FS_UPDATE = String.format(ERROR_NON_EXISTENT_FS_STRING_FORMAT, "update"); diff --git a/src/main/java/teammates/sqllogic/core/LogicStarter.java b/src/main/java/teammates/sqllogic/core/LogicStarter.java index a5ca2ccd520..704e16da163 100644 --- a/src/main/java/teammates/sqllogic/core/LogicStarter.java +++ b/src/main/java/teammates/sqllogic/core/LogicStarter.java @@ -4,6 +4,7 @@ import jakarta.servlet.ServletContextListener; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlapi.AccountRequestsDb; import teammates.storage.sqlapi.AccountsDb; import teammates.storage.sqlapi.CoursesDb; @@ -22,7 +23,7 @@ */ public class LogicStarter implements ServletContextListener { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); /** * Registers dependencies between different logic classes. diff --git a/src/main/java/teammates/storage/api/EntitiesDb.java b/src/main/java/teammates/storage/api/EntitiesDb.java index ddf464bf877..62077b437a2 100644 --- a/src/main/java/teammates/storage/api/EntitiesDb.java +++ b/src/main/java/teammates/storage/api/EntitiesDb.java @@ -18,6 +18,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.JsonUtils; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.entity.BaseEntity; /** @@ -44,7 +45,7 @@ abstract class EntitiesDb> { static final String OPTIMIZED_SAVING_POLICY_APPLIED = "Saving request is not issued because entity %s does not change by the update (%s)"; - static final Logger log = Logger.getLogger(); + static final Logger log = Logger.getLogger(Application.class); /** * Creates the entity in the database. diff --git a/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java b/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java index 8772ad7476c..849828e6be3 100644 --- a/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java +++ b/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java @@ -18,6 +18,7 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.entity.FeedbackResponseComment; /** @@ -29,7 +30,7 @@ public final class FeedbackResponseCommentsDb extends EntitiesDb { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final FeedbackResponseCommentsDb instance = new FeedbackResponseCommentsDb(); diff --git a/src/main/java/teammates/storage/api/StudentsDb.java b/src/main/java/teammates/storage/api/StudentsDb.java index 8b442dbdda0..b36be412759 100644 --- a/src/main/java/teammates/storage/api/StudentsDb.java +++ b/src/main/java/teammates/storage/api/StudentsDb.java @@ -22,6 +22,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.exception.SearchServiceException; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.entity.CourseStudent; import teammates.storage.search.SearchManagerFactory; import teammates.storage.search.StudentSearchManager; @@ -34,7 +35,7 @@ */ public final class StudentsDb extends EntitiesDb { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final int MAX_KEY_REGENERATION_TRIES = 10; diff --git a/src/main/java/teammates/storage/search/SearchManager.java b/src/main/java/teammates/storage/search/SearchManager.java index dcdb9301359..746eabb4523 100644 --- a/src/main/java/teammates/storage/search/SearchManager.java +++ b/src/main/java/teammates/storage/search/SearchManager.java @@ -22,6 +22,7 @@ import teammates.common.util.Const; import teammates.common.util.Logger; import teammates.common.util.StringHelper; +import teammates.main.Application; /** * Acts as a proxy to search service. @@ -30,7 +31,7 @@ */ abstract class SearchManager> { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final String ERROR_DELETE_DOCUMENT = "Failed to delete document(s) %s in Solr. Root cause: %s "; private static final String ERROR_SEARCH_DOCUMENT = "Failed to search for document(s) %s from Solr. Root cause: %s "; diff --git a/src/main/java/teammates/storage/sqlapi/EntitiesDb.java b/src/main/java/teammates/storage/sqlapi/EntitiesDb.java index 8ad58987ab2..d6f50221b7e 100644 --- a/src/main/java/teammates/storage/sqlapi/EntitiesDb.java +++ b/src/main/java/teammates/storage/sqlapi/EntitiesDb.java @@ -3,6 +3,7 @@ import teammates.common.util.HibernateUtil; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.BaseEntity; /** @@ -10,7 +11,7 @@ */ class EntitiesDb { - static final Logger log = Logger.getLogger(); + static final Logger log = Logger.getLogger(Application.class); /** * Copy the state of the given object onto the persistent object with the same identifier. diff --git a/src/main/java/teammates/storage/sqlsearch/SearchManager.java b/src/main/java/teammates/storage/sqlsearch/SearchManager.java index 8ded1a6e4aa..fef738964a1 100644 --- a/src/main/java/teammates/storage/sqlsearch/SearchManager.java +++ b/src/main/java/teammates/storage/sqlsearch/SearchManager.java @@ -21,6 +21,7 @@ import teammates.common.util.Const; import teammates.common.util.Logger; import teammates.common.util.StringHelper; +import teammates.main.Application; import teammates.storage.sqlentity.BaseEntity; /** @@ -30,7 +31,7 @@ */ abstract class SearchManager { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final String ERROR_DELETE_DOCUMENT = "Failed to delete document(s) %s in Solr. Root cause: %s "; private static final String ERROR_SEARCH_DOCUMENT = "Failed to search for document(s) %s from Solr. Root cause: %s "; diff --git a/src/main/java/teammates/ui/servlets/LegacyUrlMapper.java b/src/main/java/teammates/ui/servlets/LegacyUrlMapper.java index b1ecb2a1f16..a0708accdaa 100644 --- a/src/main/java/teammates/ui/servlets/LegacyUrlMapper.java +++ b/src/main/java/teammates/ui/servlets/LegacyUrlMapper.java @@ -11,6 +11,7 @@ import teammates.common.util.Config; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; /** * Maps some selected legacy URLs to new one. This is primarily for URLs send via email. @@ -20,7 +21,7 @@ @Deprecated public class LegacyUrlMapper extends HttpServlet { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { diff --git a/src/main/java/teammates/ui/servlets/LoginServlet.java b/src/main/java/teammates/ui/servlets/LoginServlet.java index 14c03632ea8..6e5dd38f9a4 100644 --- a/src/main/java/teammates/ui/servlets/LoginServlet.java +++ b/src/main/java/teammates/ui/servlets/LoginServlet.java @@ -16,13 +16,14 @@ import teammates.common.util.JsonUtils; import teammates.common.util.Logger; import teammates.common.util.StringHelper; +import teammates.main.Application; /** * Servlet that handles login. */ public class LoginServlet extends AuthServlet { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { diff --git a/src/main/java/teammates/ui/servlets/LogoutServlet.java b/src/main/java/teammates/ui/servlets/LogoutServlet.java index dcfde659e43..37569d88655 100644 --- a/src/main/java/teammates/ui/servlets/LogoutServlet.java +++ b/src/main/java/teammates/ui/servlets/LogoutServlet.java @@ -9,13 +9,14 @@ import org.apache.http.HttpStatus; import teammates.common.util.Logger; +import teammates.main.Application; /** * Servlet that handles logout. */ public class LogoutServlet extends AuthServlet { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { diff --git a/src/main/java/teammates/ui/servlets/OAuth2CallbackServlet.java b/src/main/java/teammates/ui/servlets/OAuth2CallbackServlet.java index c83cd485d20..e5f4b295b54 100644 --- a/src/main/java/teammates/ui/servlets/OAuth2CallbackServlet.java +++ b/src/main/java/teammates/ui/servlets/OAuth2CallbackServlet.java @@ -27,13 +27,14 @@ import teammates.common.util.JsonUtils; import teammates.common.util.Logger; import teammates.common.util.StringHelper; +import teammates.main.Application; /** * Servlet that handles the OAuth2 callback. */ public class OAuth2CallbackServlet extends AuthServlet { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { diff --git a/src/main/java/teammates/ui/servlets/OriginCheckFilter.java b/src/main/java/teammates/ui/servlets/OriginCheckFilter.java index cbd1e8d7b9a..f20160c76bc 100644 --- a/src/main/java/teammates/ui/servlets/OriginCheckFilter.java +++ b/src/main/java/teammates/ui/servlets/OriginCheckFilter.java @@ -24,6 +24,7 @@ import teammates.common.util.Logger; import teammates.common.util.StringHelper; import teammates.common.util.Url; +import teammates.main.Application; import teammates.ui.webapi.JsonResult; /** @@ -31,7 +32,7 @@ */ public class OriginCheckFilter implements Filter { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); private static final String ALLOWED_HTTP_METHODS = String.join(", ", Arrays.asList( HttpGet.METHOD_NAME, diff --git a/src/main/java/teammates/ui/servlets/RequestTraceFilter.java b/src/main/java/teammates/ui/servlets/RequestTraceFilter.java index 234640ee323..601d27a5722 100644 --- a/src/main/java/teammates/ui/servlets/RequestTraceFilter.java +++ b/src/main/java/teammates/ui/servlets/RequestTraceFilter.java @@ -17,6 +17,7 @@ import teammates.common.util.Config; import teammates.common.util.Logger; import teammates.common.util.RequestTracer; +import teammates.main.Application; import teammates.ui.webapi.JsonResult; /** @@ -24,7 +25,7 @@ */ public class RequestTraceFilter implements Filter { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { diff --git a/src/main/java/teammates/ui/servlets/WebApiServlet.java b/src/main/java/teammates/ui/servlets/WebApiServlet.java index eaeac90d399..1dfedea6926 100644 --- a/src/main/java/teammates/ui/servlets/WebApiServlet.java +++ b/src/main/java/teammates/ui/servlets/WebApiServlet.java @@ -15,6 +15,7 @@ import teammates.common.exception.DeadlineExceededException; import teammates.common.util.HibernateUtil; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.ui.request.InvalidHttpRequestBodyException; import teammates.ui.webapi.Action; import teammates.ui.webapi.ActionFactory; @@ -31,7 +32,7 @@ */ public class WebApiServlet extends HttpServlet { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { diff --git a/src/main/java/teammates/ui/servlets/WebPageServlet.java b/src/main/java/teammates/ui/servlets/WebPageServlet.java index ec5bb560b9e..c80b87c169a 100644 --- a/src/main/java/teammates/ui/servlets/WebPageServlet.java +++ b/src/main/java/teammates/ui/servlets/WebPageServlet.java @@ -10,13 +10,14 @@ import org.apache.http.HttpStatus; import teammates.common.util.Logger; +import teammates.main.Application; /** * Servlet that handles the single web page. */ public class WebPageServlet extends HttpServlet { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { diff --git a/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java b/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java index d1764132821..453c8ceee4c 100644 --- a/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java +++ b/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java @@ -6,6 +6,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.ui.output.CourseArchiveData; import teammates.ui.request.CourseArchiveRequest; import teammates.ui.request.InvalidHttpRequestBodyException; @@ -15,7 +16,7 @@ */ class ArchiveCourseAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/CalculateUsageStatisticsAction.java b/src/main/java/teammates/ui/webapi/CalculateUsageStatisticsAction.java index b892f36e08f..c27201ebba1 100644 --- a/src/main/java/teammates/ui/webapi/CalculateUsageStatisticsAction.java +++ b/src/main/java/teammates/ui/webapi/CalculateUsageStatisticsAction.java @@ -9,6 +9,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Logger; import teammates.common.util.TimeHelper; +import teammates.main.Application; import teammates.storage.sqlentity.UsageStatistics; /** @@ -17,7 +18,7 @@ public class CalculateUsageStatisticsAction extends AdminOnlyAction { static final int COLLECTION_TIME_PERIOD = 60; // represents one hour - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/CreateAccountAction.java b/src/main/java/teammates/ui/webapi/CreateAccountAction.java index 3e5ce9d3942..a862eac696a 100644 --- a/src/main/java/teammates/ui/webapi/CreateAccountAction.java +++ b/src/main/java/teammates/ui/webapi/CreateAccountAction.java @@ -23,6 +23,7 @@ import teammates.common.util.StringHelper; import teammates.common.util.Templates; import teammates.common.util.TimeHelper; +import teammates.main.Application; import teammates.storage.sqlentity.AccountRequest; import teammates.ui.request.InvalidHttpRequestBodyException; @@ -31,7 +32,7 @@ */ public class CreateAccountAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/CreateFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/CreateFeedbackSessionAction.java index e785f0a7312..c14ddfdfeb3 100644 --- a/src/main/java/teammates/ui/webapi/CreateFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/CreateFeedbackSessionAction.java @@ -14,6 +14,7 @@ import teammates.common.util.Logger; import teammates.common.util.SanitizationHelper; import teammates.common.util.TimeHelper; +import teammates.main.Application; import teammates.storage.sqlentity.Course; import teammates.storage.sqlentity.FeedbackQuestion; import teammates.storage.sqlentity.FeedbackSession; @@ -27,7 +28,7 @@ */ public class CreateFeedbackSessionAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/CreateFeedbackSessionLogAction.java b/src/main/java/teammates/ui/webapi/CreateFeedbackSessionLogAction.java index 5ea725da87b..528c042df1a 100644 --- a/src/main/java/teammates/ui/webapi/CreateFeedbackSessionLogAction.java +++ b/src/main/java/teammates/ui/webapi/CreateFeedbackSessionLogAction.java @@ -6,13 +6,14 @@ import teammates.common.datatransfer.logs.FeedbackSessionLogType; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; /** * Action: creates a feedback session log for the purposes of tracking and auditing. */ public class CreateFeedbackSessionLogAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/CreateNotificationAction.java b/src/main/java/teammates/ui/webapi/CreateNotificationAction.java index b2b2326fd99..f81f32fc750 100644 --- a/src/main/java/teammates/ui/webapi/CreateNotificationAction.java +++ b/src/main/java/teammates/ui/webapi/CreateNotificationAction.java @@ -7,6 +7,7 @@ import teammates.common.exception.EntityAlreadyExistsException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.Notification; import teammates.ui.output.NotificationData; import teammates.ui.request.InvalidHttpRequestBodyException; @@ -16,7 +17,7 @@ * Action: Creates a new notification banner. */ public class CreateNotificationAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() throws InvalidHttpRequestBodyException, InvalidOperationException { diff --git a/src/main/java/teammates/ui/webapi/DatastoreBackupAction.java b/src/main/java/teammates/ui/webapi/DatastoreBackupAction.java index be7e8b29001..969862379e8 100644 --- a/src/main/java/teammates/ui/webapi/DatastoreBackupAction.java +++ b/src/main/java/teammates/ui/webapi/DatastoreBackupAction.java @@ -21,6 +21,7 @@ import teammates.common.util.Const; import teammates.common.util.JsonUtils; import teammates.common.util.Logger; +import teammates.main.Application; /** * Cron job: performs Datastore backup. @@ -30,7 +31,7 @@ */ class DatastoreBackupAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionClosedRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionClosedRemindersAction.java index 8ee17f97dc2..e95ae9ff742 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionClosedRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionClosedRemindersAction.java @@ -6,6 +6,7 @@ import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; import teammates.common.util.RequestTracer; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; /** @@ -13,7 +14,7 @@ */ public class FeedbackSessionClosedRemindersAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionClosingRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionClosingRemindersAction.java index d4be980b923..26b89a2df7e 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionClosingRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionClosingRemindersAction.java @@ -13,6 +13,7 @@ import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; import teammates.common.util.RequestTracer; +import teammates.main.Application; import teammates.storage.sqlentity.DeadlineExtension; import teammates.storage.sqlentity.FeedbackSession; @@ -21,7 +22,7 @@ */ public class FeedbackSessionClosingRemindersAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersAction.java index 1e2c722dd13..bea1867864d 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersAction.java @@ -6,6 +6,7 @@ import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; import teammates.common.util.RequestTracer; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; /** @@ -13,7 +14,7 @@ */ public class FeedbackSessionOpeningRemindersAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningSoonRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningSoonRemindersAction.java index 96b7e62229d..d2cfb628f03 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningSoonRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningSoonRemindersAction.java @@ -6,13 +6,14 @@ import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; import teammates.common.util.RequestTracer; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; /** * Cron job: schedules feedback session opening soon emails to be sent. */ public class FeedbackSessionOpeningSoonRemindersAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerAction.java index ca599bda730..4e4fdf9ba6e 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerAction.java @@ -6,6 +6,7 @@ import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; /** @@ -13,7 +14,7 @@ */ public class FeedbackSessionPublishedEmailWorkerAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerAction.java index 23b2ec158bf..ad24fc0b09d 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerAction.java @@ -9,6 +9,7 @@ import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; import teammates.storage.sqlentity.Instructor; import teammates.storage.sqlentity.Student; @@ -18,7 +19,7 @@ */ public class FeedbackSessionRemindEmailWorkerAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerAction.java index 8beae79b43c..6518b5e1a78 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerAction.java @@ -8,6 +8,7 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; import teammates.storage.sqlentity.Instructor; import teammates.storage.sqlentity.Student; @@ -19,7 +20,7 @@ */ public class FeedbackSessionRemindParticularUsersEmailWorkerAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() throws InvalidHttpRequestBodyException { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerAction.java index bf3c3b4b8f8..65070d441d9 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerAction.java @@ -9,6 +9,7 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; import teammates.storage.sqlentity.Instructor; import teammates.storage.sqlentity.Student; @@ -20,7 +21,7 @@ */ public class FeedbackSessionResendPublishedEmailWorkerAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() throws InvalidHttpRequestBodyException { diff --git a/src/main/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerAction.java index 2536c8a1101..12c3d2ae8c2 100644 --- a/src/main/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerAction.java @@ -6,6 +6,7 @@ import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; /** @@ -13,7 +14,7 @@ */ public class FeedbackSessionUnpublishedEmailWorkerAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() { diff --git a/src/main/java/teammates/ui/webapi/JoinCourseAction.java b/src/main/java/teammates/ui/webapi/JoinCourseAction.java index b714e469df3..d3b4cdfa772 100644 --- a/src/main/java/teammates/ui/webapi/JoinCourseAction.java +++ b/src/main/java/teammates/ui/webapi/JoinCourseAction.java @@ -13,6 +13,7 @@ import teammates.common.util.Const; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.Course; import teammates.storage.sqlentity.Instructor; import teammates.storage.sqlentity.Student; @@ -22,7 +23,7 @@ */ public class JoinCourseAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/PublishFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/PublishFeedbackSessionAction.java index 73a6172e329..35546ad884a 100644 --- a/src/main/java/teammates/ui/webapi/PublishFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/PublishFeedbackSessionAction.java @@ -8,6 +8,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; import teammates.storage.sqlentity.Instructor; import teammates.ui.output.FeedbackSessionData; @@ -17,7 +18,7 @@ */ public class PublishFeedbackSessionAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/ResetAccountRequestAction.java b/src/main/java/teammates/ui/webapi/ResetAccountRequestAction.java index f0ff7ff86b3..cbd321cd789 100644 --- a/src/main/java/teammates/ui/webapi/ResetAccountRequestAction.java +++ b/src/main/java/teammates/ui/webapi/ResetAccountRequestAction.java @@ -9,6 +9,7 @@ import teammates.common.util.Const; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.AccountRequest; import teammates.ui.output.JoinLinkData; @@ -17,7 +18,7 @@ */ class ResetAccountRequestAction extends AdminOnlyAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override public JsonResult execute() throws InvalidOperationException { diff --git a/src/main/java/teammates/ui/webapi/SendErrorReportAction.java b/src/main/java/teammates/ui/webapi/SendErrorReportAction.java index 0214b05dda7..d852ce35d5c 100644 --- a/src/main/java/teammates/ui/webapi/SendErrorReportAction.java +++ b/src/main/java/teammates/ui/webapi/SendErrorReportAction.java @@ -1,6 +1,7 @@ package teammates.ui.webapi; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.ui.request.ErrorReportRequest; import teammates.ui.request.InvalidHttpRequestBodyException; @@ -8,7 +9,7 @@ * Actions: sends an error report to the system admin. */ class SendErrorReportAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/SubmitFeedbackResponsesAction.java b/src/main/java/teammates/ui/webapi/SubmitFeedbackResponsesAction.java index 897f39d9d88..0f2c8e47a12 100644 --- a/src/main/java/teammates/ui/webapi/SubmitFeedbackResponsesAction.java +++ b/src/main/java/teammates/ui/webapi/SubmitFeedbackResponsesAction.java @@ -21,6 +21,7 @@ import teammates.common.util.Const; import teammates.common.util.JsonUtils; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackQuestion; import teammates.storage.sqlentity.FeedbackResponse; import teammates.storage.sqlentity.FeedbackSession; @@ -40,7 +41,7 @@ */ public class SubmitFeedbackResponsesAction extends BasicFeedbackSubmissionAction { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/UnpublishFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/UnpublishFeedbackSessionAction.java index 3fe3536f2d3..b1e67dbc427 100644 --- a/src/main/java/teammates/ui/webapi/UnpublishFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/UnpublishFeedbackSessionAction.java @@ -8,6 +8,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.FeedbackSession; import teammates.storage.sqlentity.Instructor; import teammates.ui.output.FeedbackSessionData; @@ -17,7 +18,7 @@ */ public class UnpublishFeedbackSessionAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/UpdateFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/UpdateFeedbackSessionAction.java index e4352433ec8..4c675192ba6 100644 --- a/src/main/java/teammates/ui/webapi/UpdateFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateFeedbackSessionAction.java @@ -22,6 +22,7 @@ import teammates.common.util.FieldValidator; import teammates.common.util.Logger; import teammates.common.util.TimeHelper; +import teammates.main.Application; import teammates.storage.sqlentity.Course; import teammates.storage.sqlentity.DeadlineExtension; import teammates.storage.sqlentity.FeedbackSession; @@ -37,7 +38,7 @@ */ public class UpdateFeedbackSessionAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() { diff --git a/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegeAction.java b/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegeAction.java index 7bbffaff745..08499dc1980 100644 --- a/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegeAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegeAction.java @@ -9,6 +9,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.Logger; +import teammates.main.Application; import teammates.storage.sqlentity.Instructor; import teammates.ui.output.InstructorPrivilegeData; import teammates.ui.request.InstructorPrivilegeUpdateRequest; @@ -20,7 +21,7 @@ */ public class UpdateInstructorPrivilegeAction extends Action { - private static final Logger log = Logger.getLogger(); + private static final Logger log = Logger.getLogger(Application.class); @Override AuthType getMinAuthLevel() {