Type: | Package |
Title: | Tools for Analyzing 'ShinyProxy' Containers Logs |
URL: | https://tsenegas.github.io/shinyproxyLogs/ |
BugReports: | https://github.com/tsenegas/shinyproxyLogs/issues |
Version: | 0.1.0 |
Description: | Provides functions to parse and analyze logs generated by 'ShinyProxy' containers. It extracts metadata from log file names, reads log contents, and computes summary statistics (such as the total number of lines and lines containing error messages), facilitating efficient monitoring and debugging of 'ShinyProxy' deployments. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
Depends: | R (≥ 4.1.0) |
Imports: | dplyr, purrr, stringr, tibble |
RoxygenNote: | 7.3.2 |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-03-20 20:02:40 UTC; tsenegas |
Author: | Thibault Senegas [aut, cre] |
Maintainer: | Thibault Senegas <senegas.th@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-03-24 11:20:02 UTC |
Analyze ShinyProxy Log Files in a Directory
Description
This function scans a specified directory, extracts metadata from the log file names, reads their content, and computes some statistics (total number of lines and the number of lines containing "error" or "exception"). Additionally, it retrieves ShinyProxy user information from a separate directory of logs.
Usage
analyze_logs(path_container_logs, path_shinylogs = NULL)
Arguments
path_container_logs |
Character. The path to the directory containing the container logs files. |
path_shinylogs |
Character. The path to the directory containing ShinyProxy identity logs. |
Value
A list containing two data frames:
- file_info
Detailed information for each file.
- summary
Summary information grouped by container (based on
specId
,proxyId
, andstartupTime
).
Examples
## Not run:
result <- analyze_logs("path/to/containersLogs", "path/to/shinylogs")
print(result$summary)
## End(Not run)
Extract User and Proxy Mappings
Description
Internal function to extract user and container mappings from log lines.
Usage
extract_user_proxy_mapping(log_lines)
Arguments
log_lines |
A character vector containing log file lines. |
Value
A tibble with user
, proxyId
, and specId
.
Parse ShinyProxy Log File Name
Description
This function parses the name of a log file generated by ShinyProxy and extracts metadata:
specId
, proxyId
, startupTime
, and logType
.
Usage
parse_log_filename(filename)
Arguments
filename |
Character. The full path to the log file. |
Value
A data frame with the columns specId
, proxyId
, startupTime
, and logType
.
Examples
## Not run:
parse_log_filename(
"path/to/containersLogs/log_file_(stdout|stderr).log"
)
## End(Not run)
Read a Log File
Description
Internal function to read a log file, supporting both plain text and gzipped formats.
Usage
read_log_file(file)
Arguments
file |
Character. The file path to read. |
Value
A character vector of log lines.