Package com.storedobject.core
Class SystemLog
java.lang.Object
com.storedobject.core.SystemLog
This class can be used for logging adhoc information. This is not a "data" class. Also, information logged via this
class is permanent (means, it will not be rolled back even if your transaction is failed and rolled back).
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionGets the timestamp when the log entry was created.Retrieves the message associated with this log entry.list
(String name, TimestampPeriod period, int limit) Retrieves a list of SystemLog entries filtered by the specified name and starting from a given timestamp.Retrieves a list of system logs based on the provided name and condition.Retrieves a list of SystemLog entries filtered by the specified name and starting from a given timestamp.Retrieves a list of system logs based on the provided name within the specified timestamp range.static void
Logs a message into the core.SystemLog table with the specified name.
-
Method Details
-
getLoggedAt
Gets the timestamp when the log entry was created.- Returns:
- the timestamp of logging.
-
getMessage
Retrieves the message associated with this log entry.- Returns:
- the message of the log entry.
-
log
Logs a message into the core.SystemLog table with the specified name. Both the name and message parameters are required and cannot be null. The name is processed to be uppercase and trimmed to remove leading and trailing whitespace before being logged. This method guarantees that the log operation is thread-safe.- Parameters:
name
- the name associated with the log entry, processed to uppercase and trimmedmessage
- the message to be logged, with any single quotes properly escaped
-
list
Retrieves a list of system logs based on the provided name and condition.- Parameters:
name
- The name associated with the logs to be retrieved.condition
- An optional SQL condition to filter the logs.limit
- Number of entries to return.- Returns:
- A list of SystemLog instances matching the given name and condition.
-
list
Retrieves a list of system logs based on the provided name within the specified timestamp range.- Parameters:
name
- the name associated with the system logsfrom
- the starting timestamp for filtering the logsto
- the ending timestamp for filtering the logslimit
- Number of entries to return.- Returns:
- a list of system logs matching the specified name and timestamp range
-
list
Retrieves a list of SystemLog entries filtered by the specified name and starting from a given timestamp.- Parameters:
name
- The name of the log entries to retrieve.from
- The starting timestamp for log entries to be retrieved.limit
- Number of entries to return.- Returns:
- A list of SystemLog entries matching the specified name and timestamp conditions.
-
list
Retrieves a list of SystemLog entries filtered by the specified name and starting from a given timestamp.- Parameters:
name
- The name of the log entries to retrieve.period
- The period for which log entries to be retrieved.limit
- Number of entries to return.- Returns:
- A list of SystemLog entries matching the specified name and timestamp conditions.
-