Commit Graph

8 Commits

Author SHA1 Message Date
Ken Moore
6d47bf00bd oops. fix a typo. 2016-04-29 13:41:25 -04:00
Ken Moore
60fc3e1c5a API CHANGE:
Change the sysadm/settings class to rpc/settings

While here also add automatic log pruning capabilities (90 days of logs kept by default).
2016-04-29 13:10:11 -04:00
Ken Moore
4cee9244e4 Add a new API call/class:
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>
  }
}
2016-04-27 16:41:17 -04:00
Ken Moore
37224472cc Make the websocket/rest server distinctions a bit more clear. Now the logs are in websocket/restserver subdirectories, the LP file watchers will resume from the last log point (server-type aware), and a couple other changes for saving server-dependent variables. 2016-02-03 10:12:01 -05:00
Ken Moore
be12e18983 Fix up the log function so that now it will actually create/save the log. 2016-02-01 16:51:31 -05:00
Ken Moore
b36958b33a Enable a bit more logging from host/client connections. Still seems to be a problem with the log getting saved to disk though. 2016-02-01 16:37:39 -05:00
Ken Moore
c8f97a69fe Clean up a fair bit of the server backends. Getting rid of compilation warnings, signal/slot connection issues, etc.. 2016-02-01 15:39:29 -05:00
Ken Moore
80d1023921 Add a class of static functions for logfile management. This is designed to automatically create/manage daily logs, with auto-pruning of old logs to be added soon. There are a number of various overloaded functions for writing to a log file right now (QStringList, QString, QJsonObject, QJsonArray), but only the QStringList output for reading a file right now.
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.
2016-01-21 16:51:51 -05:00