YAML Output Format
YAML provides structured data that's human-readable and easy to parse programmatically.
Usage
# Explicit YAML output
logget --logs --network --yaml https://example.com
Output Schemas
When using --yaml, logget outputs structured YAML data. The format depends on whether you're in follow mode (streaming) or batch mode.
Batch Mode (Full Output)
In batch mode, the complete YAML output contains a single OutputData object:
url: https://example.com
logs:
- level: INFO
message: Console log message
time: "2024-10-31T23:00:00Z"
source: console
network:
- url: https://example.com/api/data
method: GET
status: 200
headers:
Content-Type: application/json
Content-Length: "1234"
timestamp: "2024-10-31T23:00:00Z"
type: application/json
size: 1234
resourceType: XHR
duration: 3.456789s
Follow Mode (Streaming)
In follow mode (-f), each log entry and network request is output as a separate YAML document (separated by ---):
level: INFO
message: Log message
time: "2024-10-31T23:00:00Z"
source: console
---
url: https://example.com
method: GET
status: 200
headers:
Content-Type: text/html
timestamp: "2024-10-31T23:00:01Z"
type: text/html
size: 184
resourceType: Document
Field Descriptions
OutputData (Batch Mode Only)
url(string): Visited URLlogs(array, optional): Array ofLogEntryobjectsnetwork(array, optional): Array ofNetworkEntryobjectsduration(string): Total time taken to load the page
LogEntry
level(string): Log level (DEBUG,INFO,WARN,ERROR,FATAL,LOG,TRACE)message(string): The log message contenttime(string): Timestamp in RFC3339 format (ISO 8601)source(string): Source of the log ("browser"or"console")
NetworkEntry
url(string): Request URLmethod(string): HTTP method (e.g.,GET,POST,PUT,DELETE)status(integer): HTTP status code (e.g., 200, 404, 500)headers(object): Response headers as key-value pairs (string keys and values)timestamp(string): Timestamp in RFC3339 format (ISO 8601)type(string): MIME type of the response (e.g.,"text/html","application/json")size(integer): Size of the response in bytesresourceType(string): Resource type (e.g.,"Document","XHR","Image","Script","Stylesheet","Font","Media","Manifest","WebSocket","Other")duration(float, optional): Total request duration in millisecondsdurationFormatted(string, optional): Formatted duration (e.g.,"123.45ms"or"1.23s")timeToFirstByte(float, optional): Time to first byte (TTFB) in millisecondstimeToFirstByteFormatted(string, optional): Formatted TTFB (e.g.,"50.23ms"or"0.50s")connectTime(float, optional): Connection establishment time in millisecondsconnectTimeFormatted(string, optional): Formatted connect timednsLookupTime(float, optional): DNS lookup time in millisecondsdnsLookupTimeFormatted(string, optional): Formatted DNS lookup timesslTime(float, optional): SSL/TLS handshake time in milliseconds (HTTPS only)sslTimeFormatted(string, optional): Formatted SSL timesendTime(float, optional): Time to send request in millisecondssendTimeFormatted(string, optional): Formatted send timewaitTime(float, optional): Wait time (server processing) in millisecondswaitTimeFormatted(string, optional): Formatted wait timereceiveTime(float, optional): Time to receive response headers in millisecondsreceiveTimeFormatted(string, optional): Formatted receive timecontentDownloadTime(float, optional): Full content download time (body + headers) in millisecondscontentDownloadTimeFormatted(string, optional): Formatted content download timequeuedTime(float, optional): Time from navigation start to request start in millisecondsqueuedTimeFormatted(string, optional): Formatted queued timerequestStartTime(float, optional): Request start time relative to navigation start in millisecondsrequestStartTimeFormatted(string, optional): Formatted request start timeresponseStartTime(float, optional): Response start time relative to navigation start in millisecondsresponseStartTimeFormatted(string, optional): Formatted response start timetotal(float, optional): Sum of all timing phases (Queued + DNS + Connect + SSL + Send + Wait + Receive + ContentDownload) in millisecondstotalFormatted(string, optional): Formatted total time (e.g.,"863.12ms"or"0.86s")
Resource Types
"Document": HTML documents"XHR": XMLHttpRequest / Fetch API requests"Image": Images (PNG, JPEG, GIF, etc.)"Script": JavaScript files"Stylesheet": CSS files"Font": Web fonts"Media": Audio/video files"Manifest": Web app manifests"WebSocket": WebSocket connections"Other": Other resource types
Output Format
Multi-Document Format (Follow Mode)
In follow mode, each log entry and network request is output as a separate YAML document separated by ---:
level: INFO
message: App started
time: "2024-10-31T23:00:00Z"
source: console
---
url: https://example.com/
method: GET
status: 200
resourceType: Document
This format is:
- Easy to stream and process document by document
- Human-readable
- Compatible with YAML parsers that support multi-document streams
Saving to File
# Save to file
logget --yaml --logs --network --output results.yaml https://example.com
# Append to file
logget --yaml --logs --network --append --output results.yaml https://example.com
Follow Mode
In follow mode (-f), YAML documents are streamed separated by --- as they occur:
logget -f --yaml --logs --network https://example.com
This allows real-time processing of logs and network requests.
Examples
Basic Console Logs
logget --yaml --logs https://example.com
Output (follow mode):
level: INFO
message: Application started
time: "2024-10-31T23:00:00Z"
source: console
---
level: WARN
message: Deprecated API
time: "2024-10-31T23:00:01Z"
source: console
Network Requests
logget --yaml --network https://example.com
Output (follow mode):
url: https://example.com/
method: GET
status: 200
headers:
Content-Type: text/html
timestamp: "2024-10-31T23:00:00Z"
type: text/html
size: 1256
resourceType: Document
---
url: https://example.com/api/data
method: GET
status: 200
headers:
Content-Type: application/json
timestamp: "2024-10-31T23:00:01Z"
type: application/json
size: 456
resourceType: XHR
Combined Output
logget --yaml --logs --network https://example.com
Output (follow mode, mixed console logs and network requests):
level: INFO
message: App started
time: "2024-10-31T23:00:00Z"
source: console
---
url: https://example.com/
method: GET
status: 200
resourceType: Document
---
level: ERROR
message: API error
time: "2024-10-31T23:00:01Z"
source: console
---
url: https://example.com/api/data
method: GET
status: 500
resourceType: XHR