![]() |
LogDoctor 4.00
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
|
Public Member Functions | |
void | setDialogLevel (const DialogsLevel new_level) noexcept |
Returns the Dialogs level. | |
void | setDbPath (std::string &&path) noexcept |
Sets the path for the logs Collection database. | |
void | refreshDates (std::optional< database_dates_t > &result) noexcept |
Refreshes the dates which are available in the database. | |
void | getWarningsData (std::optional< stats_warn_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView hour_) const |
Retrieves the data needed for the Warnings statistics. | |
void | getSpeedData (std::optional< stats_speed_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView protocol_f, QStringView method_f, QStringView uri_f, QStringView query_f, QStringView response_f) const |
Retrieves the data needed for the Speed statistics. | |
void | getItemsCount (std::optional< stats_count_items_t > &result, QStringView web_server, QStringView year, QStringView month, QStringView day, QStringView log_field) const |
Retrieves the data needed for the Counts statistics. | |
void | getDaytimeCounts (std::optional< stats_day_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_, QStringView field_filter) const |
Retrieves the data needed for the Daytime statistics. | |
void | getRelationalCountsDay (std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) const |
Retrieves the data needed for the Relationsl statistics. | |
void | getRelationalCountsPeriod (std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) const |
Retrieves the data needed for the Relational statistics. | |
void | getGlobalCounts (std::optional< GlobalsData > &result, QStringView web_server, const stats_dates_t &dates) const |
Retrieves the data needed for the Global statistics. | |
Private Member Functions | |
const QString & | getDbField (const LogField fld) const |
Returns the database field corresponding to the relative log field. | |
const QString & | getDbField (QStringView tr_fld) const |
Returns the database field corresponding to the relative log field. | |
int | getMonthNumber (QStringView month_str) const |
Returns the month number in the year. | |
Static Private Member Functions | |
static int | getMinuteGap (const int minute, const int gap=10) |
Returns the minute gap for the given minute with the given gap. | |
static int | getMonthDays (const int year, const int month) |
Returns the number of days for a given month. | |
static int | countDays (const int from_year, const int from_month, const int from_day, const int to_year, const int to_month, const int to_day) |
Returns the number of days in a given period. | |
static int | countMonths (const int from_year, const int from_month, const int to_year, const int to_month) noexcept |
Returns the number of months in a given period. | |
|
staticprivate |
Returns the number of days in a given period.
from_year | The initial year |
from_month | The initial month |
from_day | The initial day |
to_year | The final Year |
to_month | The final month |
to_day | The final day |
DateTimeException |
|
staticprivatenoexcept |
Returns the number of months in a given period.
from_year | The initial year |
from_month | The initial month |
to_year | The final Year |
to_month | The final month |
void DbQuery::getDaytimeCounts | ( | std::optional< stats_day_items_t > & | result, |
QStringView | web_server, | ||
QStringView | from_year_, | ||
QStringView | from_month_, | ||
QStringView | from_day_, | ||
QStringView | to_year_, | ||
QStringView | to_month_, | ||
QStringView | to_day_, | ||
const LogField | log_field_, | ||
QStringView | field_filter ) const |
Retrieves the data needed for the Daytime statistics.
result | Holds the data only if the operation completed succssfully |
web_server | The ID of the Web Server to use |
from_year_ | The initial year |
from_month_ | The initial month |
from_day_ | The initial day |
to_year_ | The final year |
to_month_ | The final month |
to_day_ | The final day |
log_field_ | The log field to filter |
field_filter | The filter to apply |
VoidException | |
CrapviewException | |
ConversionException | |
DateTimeException |
|
private |
Returns the database field corresponding to the relative log field.
fld | The log field |
CrapviewException |
|
private |
Returns the database field corresponding to the relative log field.
tr_fld | The log field, hendles translated text |
CrapviewException |
void DbQuery::getGlobalCounts | ( | std::optional< GlobalsData > & | result, |
QStringView | web_server, | ||
const stats_dates_t & | dates ) const |
Retrieves the data needed for the Global statistics.
result | Holds the data only if the operation completed succssfully |
web_server | The ID of the Web Server to use |
dates | The dates to query |
VoidException | |
CrapviewException | |
ConversionException |
void DbQuery::getItemsCount | ( | std::optional< stats_count_items_t > & | result, |
QStringView | web_server, | ||
QStringView | year, | ||
QStringView | month, | ||
QStringView | day, | ||
QStringView | log_field ) const |
Retrieves the data needed for the Counts statistics.
result | Holds the data only if the operation completed succssfully |
web_server | The ID of the Web Server to use |
year | The year |
month | The month |
day | The day |
log_field | The log field |
VoidException | |
CrapviewException | |
DateTimeException |
|
staticprivate |
Returns the minute gap for the given minute with the given gap.
minute | The minute of the hour |
gap | The gap used to split the hour |
DateTimeException |
|
staticprivate |
Returns the number of days for a given month.
year | The year, used to handle leap years |
month | The month |
DateTimeException |
|
private |
Returns the month number in the year.
month_str | The month |
DateTimeException |
void DbQuery::getRelationalCountsDay | ( | std::optional< stats_relat_items_t > & | result, |
QStringView | web_server, | ||
QStringView | year_, | ||
QStringView | month_, | ||
QStringView | day_, | ||
const LogField | log_field_1_, | ||
QStringView | field_filter_1, | ||
const LogField | log_field_2_, | ||
QStringView | field_filter_2 ) const |
Retrieves the data needed for the Relationsl statistics.
Used when querying a single day
result | Holds the data only if the operation completed succssfully |
web_server | The ID of the Web Server to use |
year_ | The year |
month_ | The month |
day_ | The day |
log_field_1_ | The first log field to filter |
field_filter_1 | The filter to apply to the first field |
log_field_2_ | The second log field to filter |
field_filter_2 | The filter to apply to the second fiend |
VoidException | |
CrapviewException | |
ConversionException | |
DateTimeException |
void DbQuery::getRelationalCountsPeriod | ( | std::optional< stats_relat_items_t > & | result, |
QStringView | web_server, | ||
QStringView | from_year_, | ||
QStringView | from_month_, | ||
QStringView | from_day_, | ||
QStringView | to_year_, | ||
QStringView | to_month_, | ||
QStringView | to_day_, | ||
const LogField | log_field_1_, | ||
QStringView | field_filter_1, | ||
const LogField | log_field_2_, | ||
QStringView | field_filter_2 ) const |
Retrieves the data needed for the Relational statistics.
Used when querying a period of time
result | Holds the data only if the operation completed succssfully |
web_server | The ID of the Web Server to use |
from_year_ | The initial year |
from_month_ | The initial month |
from_day_ | The initial day |
to_year_ | The final year |
to_month_ | The final month |
to_day_ | The final day |
log_field_1_ | The first log field to filter |
field_filter_1 | The filter to apply to the first field |
log_field_2_ | The second log field to filter |
field_filter_2 | The filter to apply to the second fiend |
VoidException | |
CrapviewException | |
ConversionException | |
DateTimeException |
void DbQuery::getSpeedData | ( | std::optional< stats_speed_items_t > & | result, |
QStringView | web_server, | ||
QStringView | year_, | ||
QStringView | month_, | ||
QStringView | day_, | ||
QStringView | protocol_f, | ||
QStringView | method_f, | ||
QStringView | uri_f, | ||
QStringView | query_f, | ||
QStringView | response_f ) const |
Retrieves the data needed for the Speed statistics.
result | Holds the data only if the operation completed succssfully |
web_server | The ID of the Web Server to use |
year_ | The year |
month_ | The month |
day_ | The day |
protocol_f | The filter for the Protocol field |
method_f | The filter for the Method field |
uri_f | The filter for the URI field |
query_f | The filter for the Query field |
response_f | The filter for the Response field |
VoidException | |
CrapviewException | |
ConversionException | |
DateTimeException |
void DbQuery::getWarningsData | ( | std::optional< stats_warn_items_t > & | result, |
QStringView | web_server, | ||
QStringView | year_, | ||
QStringView | month_, | ||
QStringView | day_, | ||
QStringView | hour_ ) const |
Retrieves the data needed for the Warnings statistics.
result | Holds the data only if the operation completed succssfully |
web_server | The ID of the Web Server to use |
year_ | The year |
month_ | The month |
day_ | The day |
hour_ | The hour |
VoidException | |
ConversionException | |
DateTimeException |
|
noexcept |
Refreshes the dates which are available in the database.
result | Holds the data only if the operation completed succssfully |
VoidException | |
ConversionException |
|
noexcept |
Sets the path for the logs Collection database.