Logging
Railtracks provides built-in logging to help track the execution of your flows. Logs are automatically generated and can be viewed in the terminal or saved to a file.
Example Logs
[+3.525 s] RT : INFO - START CREATED Github Agent
[+8.041 s] RT : INFO - Github Agent CREATED create_issue
[+8.685 s] RT : INFO - create_issue DONE
[+14.333 s] RT : INFO - Github Agent CREATED assign_copilot_to_issue
[+14.760 s] RT : INFO - assign_copilot_to_issue DONE
[+17.540 s] RT : INFO - Github Agent CREATED assign_copilot_to_issue
[+18.961 s] RT : INFO - assign_copilot_to_issue DONE
[+23.401 s] RT : INFO - Github Agent DONE
Configuring Logging
Logging Levels
Railtracks supports four logging levels:
VERBOSE
: Includes all logs, includingDEBUG
.REGULAR
: (Default) IncludesINFO
and above. Ideal for local development.QUIET
: IncludesWARNING
and above. Recommended for production.NONE
: Disables all logging.
Logging Handlers
Console Handler
By default, logs are printed to stdout
and stderr
.
Custom Handlers
Railtracks uses the standard Python logging
module with the RT
prefix. You can attach custom handlers:
Example Usage
You can configure logging globally or per-run.
Forwarding Logs to External Services
You can forward logs to services like Loggly, Sentry, or Conductr by attaching custom handlers. Refer to each provider's documentation for integration details.
Log Message Examples
DEBUG Messages
Type | Example |
---|---|
Runner Created | RT.Runner : DEBUG - Runner <RUNNER_ID> is initialized |
Node Created | RT.Publisher: DEBUG - RequestCreation(current_node_id=<PARENT_NODE_ID>, new_request_id=<REQUEST_ID>, running_mode=async, new_node_type=<NODE_NAME>, args=<INPUT_ARGS>, kwargs=<INPUT_KWARGS>) |
Node Completed | RT.Publisher: DEBUG - <NODE_NAME> DONE with result <RESULT> |
INFO Messages
Type | Example |
---|---|
Initial Request | RT : INFO - START CREATED <NODE_NAME> |
Invoking Nodes | RT : INFO - <PARENT_NODE_NAME> CREATED <CHILD_NODE_NAME> |
Node Completed | RT : INFO - <NODE_NAME> DONE |
Run Data Saved | RT.Runner : INFO - Saving execution info to .railtracks\<RUNNER_ID>.json |
WARNING Messages
Type | Example |
---|---|
Overwriting File | RT.Runner : WARNING - File .railtracks\<RUNNER_ID>.json already exists, overwriting... |
ERROR Messages
Type | Example |
---|---|
Node Failed | RT : ERROR - <NODE_NAME> FAILED |