Skip to main content

mr log entity

Fetch every log entry recorded for one specific entity. Both --entity-type (e.g. group, resource, note, tag) and --entity-id are required. The response is the same paginated wrapper logs list returns, so the logs array contains the actual rows and pagination is controlled by the global --page flag.

This is the reliable way to discover a log row's ID from code: create or touch an entity, then query its history to get the id value used by log get. The action field (create, update, delete, system) lets scripts filter to just the events they care about.

Usage

mr log entity

Examples

List every log entry for group 42

mr log entity --entity-type=group --entity-id=42

Pull only the actions for one resource

mr log entity --entity-type=resource --entity-id=7 --json | jq -r '.logs[].action'

Flags

FlagTypeDefaultDescription
--entity-typestring``Entity type (required) (required)
--entity-iduint0Entity ID (required) (required)

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output

Paginated wrapper with logs (array of entries), totalCount, page, perPage; each entry has id, level, action, entityType, entityId, entityName, message, requestPath, createdAt (lowercase keys)

Exit Codes

0 on success; 1 on any error

See Also