namespace: "sysadm"
name: "logs"
This is a class used for interacting with the log files created by the sysadm server.
"action":"read_logs"
Optional Arguments:
"logs" : array/string of log type(s) (valid types: "hostinfo", "dispatcher", "events-dispatcher","events-lifepreserver","events-state"
"time_format" : one of the following formats (required for custom start/end times below). Valid Formats: "time_t_seconds", "epoch_mseconds, "relative_[day/month/second]", or a QDateTime String code (see http://doc.qt.io/qt-5/qdatetime.html#fromString for details).
"start_time" : "<number/string corresponding to format above>"
"end_time" : "<number/string corresponding to format above>"
If the time_format is missing, or the start/end times are not defined, the end time will be the current date/time, and the start time will be 12 hours previous.
If the "logs" argument is missing/empty, then all logs matching the search parameters will be returned.
Example Input:
{
"action" : "read_logs",
"time_format" : "relative_second",
"start_time" : "-3600"
}
This returns all log entries within the last hour.
Return Format:
"args" : {
"<log_file_type>" : {
"<date_time_stamp>" : <message>,
"<date_timo_stamp2>" : <message>
}
}
To add a new type of log file:
1) Add a new enumeration definition for the file in LogManager.h
2) Add an entry for that new enumeration in the flagToPath() function right below the enumeration definion.