Skip to content

adding native logging#1188

Merged
haixuanTao merged 5 commits intomainfrom
add-native-python-logging
Nov 24, 2025
Merged

adding native logging#1188
haixuanTao merged 5 commits intomainfrom
add-native-python-logging

Conversation

@haixuanTao
Copy link
Copy Markdown
Collaborator

@haixuanTao haixuanTao commented Nov 11, 2025

This PR makes it possible to use both rust and python native logging system and get formatting and filtering within dora run. This also persist the logs within the logging filesystem as json making them searchable through tool like elastic search, Grafana Loki, ...

This improve the current stdout by adding:

  • file path information
  • line id
  • levels
  • target
  • and fields that can be fully customizable
  • usable with send_stdout_as and receive event as text json lines in order to use a custom log aggregator user node.
  • Usable with opentelemetry in order to use an external opentelemetry aggregator / collector

To use in rust:

use tracing:warn:

warn!("my message"); 

To use in python

import logging

logging.warn("my message")

To filter log, just as before use RUST_LOG env variable.

The output is going to be formatted as is:

Output

INFO  receive_data_with_sleep: root  info [108171982329125]
DEBUG receive_data_with_sleep: __main__  received tick with data
INFO  receive_data_with_sleep: root  info [108171991792958]
DEBUG receive_data_with_sleep: __main__  received tick with data
INFO  receive_data_with_sleep: root  info [108172002233958]
DEBUG receive_data_with_sleep: __main__  received tick with data
INFO  receive_data_with_sleep: root  info [108172012020041]
DEBUG receive_data_with_sleep: __main__  received tick with data
INFO  receive_data_with_sleep: root  info [108172022420791]
DEBUG receive_data_with_sleep: __main__  received tick with data
INFO  receive_data_with_sleep: root  info [108172032057625]
DEBUG receive_data_with_sleep: __main__  received tick with data

You will find attached example within the PR

@haixuanTao haixuanTao force-pushed the add-native-python-logging branch from 04e9517 to d051efd Compare November 12, 2025 03:17
@haixuanTao haixuanTao force-pushed the add-native-python-logging branch 2 times, most recently from 423408d to c8560f4 Compare November 21, 2025 05:12
@haixuanTao haixuanTao force-pushed the add-native-python-logging branch from d6e7326 to 5d58552 Compare November 24, 2025 11:40
@haixuanTao haixuanTao force-pushed the add-native-python-logging branch from 5d58552 to d1f91fe Compare November 24, 2025 12:00
@haixuanTao haixuanTao force-pushed the add-native-python-logging branch from d1f91fe to ecfada0 Compare November 24, 2025 12:06
@haixuanTao haixuanTao merged commit aceb7d4 into main Nov 24, 2025
50 checks passed
@haixuanTao haixuanTao deleted the add-native-python-logging branch November 24, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants