Skip to content

LogChannel

Internal

Not re-exported through require(Operator). This is not part of the public API and may move in a minor release. It is documented because understanding it matters when you are debugging, not because you should construct one. The internal path is ServerStorage.Operator.Server.LogChannel.

Serves log panel queries over the remote. It owns the permission check, the rate limit and the payload validation, so Transport only routes.

Functions

LogChannel.new

luau
LogChannel.new(options: Options): LogChannel

Returns a channel whose handle(player, payload) answers one query.

Checks run cheapest-first and bail at the first failure: connected, well-formed payload, permitted, within rate limit, then the query itself. A refusal sends back ok = false with a status and no records, never a reason a caller could probe with.

LogChannel.validate

luau
LogChannel.validate(payload: any): (boolean, string?)

Whether a query payload is well-formed: stream whitelisted, search a string within Protocol.MaxLogSearchLength, days and limit positive numbers and not NaN.

LogChannel.readCursor

luau
LogChannel.readCursor(value: any): Cursor?

Parses a client-supplied cursor, or nil if it is malformed. Rejects non-numbers, NaN, negatives and absurd offsets, and floors what it accepts.

Types

Options

luau
type Options = {
	actionLog: ActionLog?,
	canViewLogs: ((player: Player) -> boolean)?,
	logger: Log.Logger?,
	send: (player: Player, messageType: string, payload: any) -> (),
	isConnected: (player: Player) -> boolean,
	takeToken: (player: Player) -> boolean,
}
FieldMeaning
actionLogthe ActionLog to query; absent means Unavailable
canViewLogspermission predicate; absent means nobody can read logs
sendhow to reply to the player
isConnectedre-checked after the query, since it can yield
takeTokenthe rate limiter; returning false refuses with RateLimited

It fails closed

With no canViewLogs, every request is refused. A permission check that raises is a refusal, not an approval.

Statuses

StatusMeaning
Okrecords returned
Deniednot permitted
Unavailablelogging is off, or the query failed
RateLimitedtoo many queries; try again shortly
Invalidthe payload was malformed

Released under the MIT Licence.