log_viewer

Path-safe listing and tail-read of Gingee server and app log files. Engine-internal / privileged platform only — not for sandboxed app require. Server: {projectRoot}/logs/gingee-YYYY-MM-DD.log App: {webPath}/{appName}/box/logs/app-YYYY-MM-DD.log
Description:
  • Path-safe listing and tail-read of Gingee server and app log files. Engine-internal / privileged platform only — not for sandboxed app require. Server: {projectRoot}/logs/gingee-YYYY-MM-DD.log App: {webPath}/{appName}/box/logs/app-YYYY-MM-DD.log

Members

(inner, constant) MAX_READ_BYTES

Description:
  • Max bytes to read from end of file when tailing
Max bytes to read from end of file when tailing

Methods

(inner) appLogsDir(webPath, appName) → {string}

Parameters:
Name Type Description
webPath string
appName string
Returns:
Type
string

(inner) clampLines(n, fallback) → {number}

Parameters:
Name Type Description
n number | string | null | undefined
fallback number
Returns:
Type
number

(inner) isLogViewerQueryNoise(entry) → {boolean}

Description:
  • True if this line is noise from the Glade Logs viewer itself (list/read APIs).
Parameters:
Name Type Description
entry object
Returns:
Type
boolean

(inner) lineMatchesFilters(entry, levelFilter, engineOnly, q, hideLogQueries) → {boolean}

Parameters:
Name Type Description
entry object
levelFilter string | null error|warn|info|all|null
engineOnly boolean if true, drop lines with app set
q string | null substring search (case-insensitive)
hideLogQueries boolean if true, drop Glade Logs API noise
Returns:
Type
boolean

(inner) listLogFiles(opts) → {Object}

Description:
  • List .log files in a log directory (newest mtime first).
Parameters:
Name Type Description
opts object
Properties
Name Type Attributes Description
scope string
appName string <optional>
projectRoot string
webPath string
Returns:
Type
Object

(inner) parseLogLine(line) → {object}

Description:
  • Parse one log line into a display object.
Parameters:
Name Type Description
line string
Returns:
Type
object

(inner) readFileTail(absPath, maxBytes) → {Object}

Description:
  • Read last portion of a file as UTF-8 string.
Parameters:
Name Type Description
absPath string
maxBytes number
Returns:
Type
Object

(inner) readLogFile(opts) → {object}

Description:
  • Tail and parse a log file.
Parameters:
Name Type Description
opts object
Properties
Name Type Attributes Description
scope string
appName string <optional>
file string <optional>
basename; default newest
lines number <optional>
level string <optional>
engineOnly boolean <optional>
hideLogQueries boolean <optional>
default true: hide Glade Logs API noise
q string <optional>
projectRoot string
webPath string
Returns:
Type
object

(inner) resolveLogDir(opts) → {string}

Description:
  • Resolve a log directory for scope; throws on invalid scope/app.
Parameters:
Name Type Description
opts object
Properties
Name Type Attributes Description
scope string server | app
appName string <optional>
projectRoot string
webPath string
Returns:
absolute dir
Type
string

(inner) resolveLogFile(dir, fileName) → {string}

Description:
  • Resolve a specific log file under an allowed directory.
Parameters:
Name Type Description
dir string
fileName string
Returns:
absolute file path
Type
string

(inner) serverLogsDir(projectRoot) → {string}

Parameters:
Name Type Description
projectRoot string
Returns:
Type
string