Package com.avoka.fc.core.service
Class ErrorLogService
java.lang.Object
com.avoka.fc.core.service.ErrorLogService
Provides an ErrorLog Service.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Provides an ErrorLog JSON message. -
Constructor Summary
ConstructorDescriptionCreate an error log service with not error type defined.ErrorLogService
(String errorType) Create an error log service for the given error type. -
Method Summary
Modifier and TypeMethodDescriptioncreateErrorLog
(org.apache.cayenne.access.DataContext dataContext, Throwable error, String userName, jakarta.servlet.http.HttpServletRequest request, Submission submission) Create an error log entry for the given exception.createErrorLog
(org.apache.cayenne.access.DataContext dataContext, Throwable error, String userName, jakarta.servlet.http.HttpServletRequest request, Submission submission, EmailQueue emailQueue, JobAction jobAction) Create an error log entry for the given exception, logged in userName and requestUrl.createErrorLog
(org.apache.cayenne.access.DataContext dataContext, Throwable error, String userName, jakarta.servlet.http.HttpServletRequest request, Submission submission, EmailQueue emailQueue, JobAction jobAction, boolean groovyError, String message) Create an error log entry for the given exception, logged in userName and requestUrl.createJavaScriptErrorLog
(String context, String stacktrace, jakarta.servlet.http.HttpServletRequest request, Submission submission) Create a Form JavaScript error log record to support the Open UX API.Log an error with the given class source, user message and context.Log an error with the given class source, user message, context and cause.Log an error with the given class source, user message, context and cause.logException
(Throwable error) Logs an Exception.logException
(Throwable error, boolean autoRollback) Deprecated.autoRollback behaviour has been removed as of TM 4.1.logException
(Throwable error, EmailQueue emailQueue) Logs an Exception.logException
(Throwable error, Submission submission) Logs an Exception.logException
(Throwable error, jakarta.servlet.http.HttpServletRequest request) Logs an Exception.logException
(Throwable error, jakarta.servlet.http.HttpServletRequest request, boolean autoRollback, Submission submission) Deprecated.autoRollback behaviour has been removed as of TM 4.1.logException
(Throwable error, jakarta.servlet.http.HttpServletRequest request, boolean autoRollback, Submission submission, EmailQueue emailQueue) Deprecated.autoRollback behaviour has been removed as of TM 4.1.logException
(Throwable error, jakarta.servlet.http.HttpServletRequest request, Submission submission, EmailQueue emailQueue) Logs an Exception.logExceptionNoRollback
(Throwable error, EmailQueue emailQueue) Deprecated.autoRollback behaviour has been removed as of TM 4.1, use logException(Throwable, EmailQueue) insteadlogExceptionNoRollback
(Throwable error, Submission submission) Deprecated.autoRollback behaviour has been removed as of TM 4.1, use logException(Throwable, Submission) insteadlogExceptionNoRollback
(Throwable error, jakarta.servlet.http.HttpServletRequest request) Deprecated.autoRollback behaviour has been removed as of TM 4.1, use logException(Throwable, HttpServletRequest) insteadlogGroovyException
(Throwable error, jakarta.servlet.http.HttpServletRequest request, Submission submission) Logs an Groovy Script Exception.void
logJobActionError
(Throwable error, JobAction jobAction, Submission submission) Deprecated.void
logJobActionError
(Throwable error, JobAction jobAction, Submission submission, boolean groovyError) Log a JobAction exception to the error log.
-
Constructor Details
-
ErrorLogService
public ErrorLogService()Create an error log service with not error type defined.- Since:
- 4.3.4
-
ErrorLogService
Create an error log service for the given error type.- Parameters:
errorType
- the error type.- Since:
- 4.3.4
-
-
Method Details
-
logError
Log an error with the given class source, user message and context. This method will not rollback any transactions.- Parameters:
source
- the source class of the erroruserMsg
- the end user display messagecontext
- the context- Returns:
- a new ErrorLog record
-
logError
Log an error with the given class source, user message, context and cause. This method will not rollback any transactions.- Parameters:
source
- the source class of the erroruserMsg
- the end user display messagecontext
- the contextcause
- the Throwable causing the error- Returns:
- a new ErrorLog record
- Since:
- 4.1.0
-
logError
public ErrorLog logError(Class source, String userMsg, String context, Throwable cause, Submission submission) Log an error with the given class source, user message, context and cause. The error will be associated with the given submission. This method will not rollback any transactions.- Parameters:
source
- the source class of the erroruserMsg
- the end user display messagecontext
- the contextcause
- the Throwable causing the errorsubmission
- the submission associated with the error- Returns:
- a new ErrorLog record
- Since:
- 4.1.0
-
logException
Logs an Exception.- Parameters:
error
- the error to log- Returns:
- the created error log record
-
logException
Logs an Exception.- Parameters:
error
- the error to logsubmission
- the associated submission with error- Returns:
- the created error log record
-
logException
Logs an Exception.- Parameters:
error
- the error to logemailQueue
- the associated email queue item- Returns:
- the created error log record
-
logException
Logs an Exception.- Parameters:
error
- the error to logrequest
- the servlet request (optional)- Returns:
- the created error log record
-
logGroovyException
public ErrorLog logGroovyException(Throwable error, jakarta.servlet.http.HttpServletRequest request, Submission submission) Logs an Groovy Script Exception. Note that this method creates its own DataContext to commit the error log entity.- Parameters:
error
- the error to logrequest
- the servlet request (optional)submission
- the associated submission with error (optinal)- Returns:
- the created error log record
- Since:
- 4.3.4
-
logException
public ErrorLog logException(Throwable error, jakarta.servlet.http.HttpServletRequest request, Submission submission, EmailQueue emailQueue) Logs an Exception. Note that this method creates its own DataContext to commit the error log entity.- Parameters:
error
- the error to logrequest
- the servlet request (optional)submission
- the associated submission with erroremailQueue
- the email queue to send- Returns:
- the created error log record
- Since:
- 4.1.0
-
logJobActionError
@Deprecated public void logJobActionError(Throwable error, JobAction jobAction, Submission submission) Deprecated.Log a JobAction exception to the error log.- Parameters:
error
- the error to log (required)jobAction
- the associated job action (optional)submission
- the associated submission- Since:
- 4.1.0
-
logJobActionError
public void logJobActionError(Throwable error, JobAction jobAction, Submission submission, boolean groovyError) Log a JobAction exception to the error log.- Parameters:
error
- the error to log (required)jobAction
- the associated job action (optional)groovyError
- the error is associated with a GroovyJobActionsubmission
- the associated submission- Since:
- 4.3.4
-
createErrorLog
public ErrorLog createErrorLog(org.apache.cayenne.access.DataContext dataContext, Throwable error, String userName, jakarta.servlet.http.HttpServletRequest request, Submission submission) Create an error log entry for the given exception.- Parameters:
dataContext
- the dataContext to create the error log witherror
- the error to loguserName
- the logged in userNamerequest
- the http requestsubmission
- the associated submission with error- Returns:
- a new ErrorLog
-
createErrorLog
public ErrorLog createErrorLog(org.apache.cayenne.access.DataContext dataContext, Throwable error, String userName, jakarta.servlet.http.HttpServletRequest request, Submission submission, EmailQueue emailQueue, JobAction jobAction) Create an error log entry for the given exception, logged in userName and requestUrl. Note you should specify a new DataContext for this method, as the previous thread local data context may be in an error state.- Parameters:
dataContext
- the dataContext to create the error log witherror
- the error to loguserName
- the logged in userNamerequest
- the http requestsubmission
- the associated submission with erroremailQueue
- the email queue to sendjobAction
- the job action- Returns:
- a new ErrorLog
-
createErrorLog
public ErrorLog createErrorLog(org.apache.cayenne.access.DataContext dataContext, Throwable error, String userName, jakarta.servlet.http.HttpServletRequest request, Submission submission, EmailQueue emailQueue, JobAction jobAction, boolean groovyError, String message) Create an error log entry for the given exception, logged in userName and requestUrl. Note you should specify a new DataContext for this method, as the previous thread local data context may be in an error state.- Parameters:
dataContext
- the dataContext to create the error log witherror
- the error to loguserName
- the logged in userNamerequest
- the http requestsubmission
- the associated submission with erroremailQueue
- the email queue to sendjobAction
- the job actiongroovyError
- the error is a groovy errormessage
- the error log message- Returns:
- a new ErrorLog
- Since:
- 17.1.0
-
createJavaScriptErrorLog
public ErrorLog createJavaScriptErrorLog(String context, String stacktrace, jakarta.servlet.http.HttpServletRequest request, Submission submission) Create a Form JavaScript error log record to support the Open UX API.- Parameters:
context
- the Form context of the errorstacktrace
- the JavaScript stacktracerequest
- the HTTP request (required)submission
- the submission record (required)- Returns:
- a new ErrorLog
- Since:
- 18.5.0
-
logException
Deprecated.autoRollback behaviour has been removed as of TM 4.1. Use logException(Throwable) instead.Logs an Exception. DO NOT USE. This method may be removed in the future.- Parameters:
error
- the error to logautoRollback
- the thread data context should be rolled back (NOTE: as of TM 4.1, this parameter is being ignored)- Returns:
- the created error log record
-
logException
@Deprecated public ErrorLog logException(Throwable error, jakarta.servlet.http.HttpServletRequest request, boolean autoRollback, Submission submission) Deprecated.autoRollback behaviour has been removed as of TM 4.1. Use logException(Throwable, HttpServletRequst, Submission, EmailQueue) instead.Logs an Exception. DO NOT USE. This method may be removed in the future.- Parameters:
error
- the error to logrequest
- http requestautoRollback
- whether to roll back first (NOTE: as of TM 4.1, this parameter is being ignored)submission
- the associated submission with error- Returns:
- the created error log record
-
logException
@Deprecated public ErrorLog logException(Throwable error, jakarta.servlet.http.HttpServletRequest request, boolean autoRollback, Submission submission, EmailQueue emailQueue) Deprecated.autoRollback behaviour has been removed as of TM 4.1. Use logException(Throwable, HttpServletRequst, Submission, EmailQueue) instead.Logs an Exception. DO NOT USE. This method may be removed in the future. Note that this method contains database transactions.- Parameters:
error
- the error to logrequest
- the servlet request (optional)autoRollback
- the thread data context should be rolled back (NOTE: as of TM 4.1, this parameter is being ignored)submission
- the associated submission with erroremailQueue
- the email queue to send- Returns:
- the created error log record
-
logExceptionNoRollback
Deprecated.autoRollback behaviour has been removed as of TM 4.1, use logException(Throwable, Submission) insteadLog an exception. DO NOT USE. This method may be removed in the future.- Parameters:
error
- the error to logsubmission
- the associated submission with error- Returns:
- the created error log record
-
logExceptionNoRollback
Deprecated.autoRollback behaviour has been removed as of TM 4.1, use logException(Throwable, EmailQueue) insteadLog an exception. DO NOT USE. This method may be removed in the future.- Parameters:
error
- the error to logemailQueue
- email queue- Returns:
- the created error log record
-
logExceptionNoRollback
@Deprecated public ErrorLog logExceptionNoRollback(Throwable error, jakarta.servlet.http.HttpServletRequest request) Deprecated.autoRollback behaviour has been removed as of TM 4.1, use logException(Throwable, HttpServletRequest) insteadCreate an ErrorLog record from the given error and request. DO NOT USE. This method may be removed in the future.- Parameters:
error
- the error to logrequest
- the servlet request (optional)- Returns:
- the created error log record
- Since:
- 4.0.0
-