Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#10950] Filter logs by feedback session name #11069

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a6877c8
[#10950] Add audit-logs to CI workflow (#10966)
madanalogy Feb 15, 2021
8b55b96
[#10950] Add logging endpoint for audit logs (#10985)
halfwhole Mar 3, 2021
d4aa509
Revert config files (#10978)
AdithyaNarayan Mar 14, 2021
76fcd8e
[#10950] Track student feedback session in frontend (#11005)
AdithyaNarayan Mar 14, 2021
7202593
[#10950] Add audit-logs to CI workflow (#10966)
madanalogy Feb 15, 2021
071301b
[#10950] Add logging endpoint for audit logs (#10985)
halfwhole Mar 3, 2021
c9c5e16
Revert config files (#10978)
AdithyaNarayan Mar 14, 2021
5222c68
[#10950] Track student feedback session in frontend (#11005)
AdithyaNarayan Mar 14, 2021
8bc9e64
Merge branch 'audit-logs' of https://github.com/TEAMMATES/teammates i…
madanalogy Mar 15, 2021
5f97283
[#10950] Add logging functionality to backend (#10984)
halfwhole Mar 21, 2021
cfedb58
[#10969] Search form for audit logs page (#11006)
t-cheepeng Mar 21, 2021
1da3044
[#10950] Add audit-logs to CI workflow (#10966)
madanalogy Feb 15, 2021
d435c91
[#10950] Add logging endpoint for audit logs (#10985)
halfwhole Mar 3, 2021
c091443
Revert config files (#10978)
AdithyaNarayan Mar 14, 2021
ba8cc29
[#10950] Track student feedback session in frontend (#11005)
AdithyaNarayan Mar 14, 2021
a9b117a
[#10950] Add logging endpoint for audit logs (#10985)
halfwhole Mar 3, 2021
82f77fd
Revert config files (#10978)
AdithyaNarayan Mar 14, 2021
af5fdb7
[#10950] Add logging functionality to backend (#10984)
halfwhole Mar 21, 2021
f28a9f5
[#10969] Search form for audit logs page (#11006)
t-cheepeng Mar 21, 2021
cfbda11
Merge branch 'audit-logs' of https://github.com/TEAMMATES/teammates i…
madanalogy Mar 22, 2021
fcb84d9
[#10950] Refactor getting of error log entries (#11050)
halfwhole Mar 22, 2021
a3fe5bc
Change to email (#11062)
AdithyaNarayan Mar 24, 2021
9b5d537
Add fsName param to get logs backend
Mar 26, 2021
5eb1ace
Add fsName picker in frontend
Mar 28, 2021
a2051a5
Update snapshots
Mar 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- master
- release
- audit-logs
pull_request:
branches:
- master
- release
- audit-logs
schedule:
- cron: "0 0 * * *" #end of every day
jobs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- master
- release
- audit-logs
pull_request:
branches:
- master
- release
- audit-logs
schedule:
- cron: "0 0 * * *" #end of every day
jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lnp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- release
- audit-logs
jobs:
LnP-testing:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package teammates.common.datatransfer;

import teammates.common.datatransfer.attributes.FeedbackSessionAttributes;
import teammates.common.datatransfer.attributes.StudentAttributes;

/**
* Represents a log entry of a feedback session.
*/
public class FeedbackSessionLogEntry {
private final StudentAttributes student;
private final FeedbackSessionAttributes feedbackSession;
private final String feedbackSessionLogType;
private final long timestamp;

public FeedbackSessionLogEntry(StudentAttributes student, FeedbackSessionAttributes feedbackSession,
String feedbackSessionLogType, long timestamp) {
this.student = student;
this.feedbackSession = feedbackSession;
this.feedbackSessionLogType = feedbackSessionLogType;
this.timestamp = timestamp;
}

public StudentAttributes getStudent() {
return this.student;
}

public FeedbackSessionAttributes getFeedbackSession() {
return this.feedbackSession;
}

public String getFeedbackSessionLogType() {
return this.feedbackSessionLogType;
}

public long getTimestamp() {
return this.timestamp;
}
}
17 changes: 17 additions & 0 deletions src/main/java/teammates/common/exception/LogServiceException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package teammates.common.exception;

/**
* Exception thrown when the logs service fails to create or retrieve logs.
*/
@SuppressWarnings("serial")
public class LogServiceException extends Exception {

public LogServiceException(String message) {
super(message);
}

public LogServiceException(Throwable cause) {
super(cause);
}

}
10 changes: 10 additions & 0 deletions src/main/java/teammates/common/util/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public static class ParamsNames {
public static final String FEEDBACK_SESSION_STARTTIME = "starttime";
public static final String FEEDBACK_SESSION_ENDTIME = "endtime";
public static final String FEEDBACK_SESSION_MODERATED_PERSON = "moderatedperson";
public static final String FEEDBACK_SESSION_LOG_TYPE = "fsltype";
public static final String FEEDBACK_SESSION_LOG_STARTTIME = "fslstarttime";
public static final String FEEDBACK_SESSION_LOG_ENDTIME = "fslendtime";

public static final String FEEDBACK_QUESTION_ID = "questionid";

Expand Down Expand Up @@ -186,6 +189,11 @@ public static class CsrfConfig {

}

public static class FeedbackSessionLogTypes {
public static final String ACCESS = "access";
public static final String SUBMISSION = "submission";
}

@Deprecated
public static class LegacyURIs {

Expand Down Expand Up @@ -291,6 +299,8 @@ public static class ResourceURIs {
public static final String SESSION_LINKS_RECOVERY = URI_PREFIX + "/sessionlinksrecovery";
public static final String NATIONALITIES = URI_PREFIX + "/nationalities";
public static final String EMAIL = URI_PREFIX + "/email";
public static final String TRACK_SESSION = URI_PREFIX + "/track/session";
public static final String SESSION_LOGS = URI_PREFIX + "/logs/session";

public static final String STUDENT_PROFILE_PICTURE = URI_PREFIX + "/student/profilePic";
public static final String STUDENT_PROFILE = URI_PREFIX + "/student/profile";
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/teammates/logic/api/LogsProcessor.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package teammates.logic.api;

import java.time.Instant;
import java.util.List;

import teammates.common.datatransfer.ErrorLogEntry;
import teammates.common.datatransfer.FeedbackSessionLogEntry;
import teammates.common.exception.LogServiceException;
import teammates.common.util.Config;
import teammates.logic.core.GoogleCloudLoggingService;
import teammates.logic.core.LocalLoggingService;
Expand Down Expand Up @@ -33,4 +36,21 @@ public List<ErrorLogEntry> getRecentErrorLogs() {
return service.getRecentErrorLogs();
}

/**
* Creates a feedback session log.
*/
public void createFeedbackSessionLog(String courseId, String email, String fsName, String fslType)
throws LogServiceException {
service.createFeedbackSessionLog(courseId, email, fsName, fslType);
}

/**
* Gets the feedback session logs as filtered by the given parameters.
* @param email Can be null
*/
public List<FeedbackSessionLogEntry> getFeedbackSessionLogs(String courseId, String email,
String feedbackSessionName, Instant startTime, Instant endTime) throws LogServiceException {
return service.getFeedbackSessionLogs(courseId, email, feedbackSessionName, startTime, endTime);
}

}