From bfbe9b86d45149dac2365f93e68b2b6aff93d177 Mon Sep 17 00:00:00 2001 From: Ayooluwa Isaiah Date: Sun, 9 Feb 2025 23:10:22 +0100 Subject: [PATCH] make example project work with cloud ingesting --- example-project/README.md | 6 +++--- example-project/example-project.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example-project/README.md b/example-project/README.md index d5de0f5..03dd3f7 100644 --- a/example-project/README.md +++ b/example-project/README.md @@ -17,10 +17,10 @@ pip install logtail-python To run the example application, simply run the following command: ```bash -python example-project.py +python example-project.py ``` -Don't forget to replace `` with your actual source toke which you can find in the source settings. +_Don't forget to replace `` and `` with your actual source token and ingesting host which you can find by going to **[Sources](https://telemetry.betterstack.com/team/0/sources) -> Configure** in Better Stack._ If you have trouble running the command above, check your Python installation and try running it with the `python3` command instead. @@ -51,7 +51,7 @@ Then we need to create a `handler`, which will be responsible for handling our l ```python # Create handler -handler = LogtailHandler(source_token=sys.argv[1]) +handler = LogtailHandler(source_token=sys.argv[1], host=sys.argv[2]) # Create logger logger = logging.getLogger(__name__) diff --git a/example-project/example-project.py b/example-project/example-project.py index fd21a35..e944880 100644 --- a/example-project/example-project.py +++ b/example-project/example-project.py @@ -10,12 +10,12 @@ import sys # Check for program arguments -if len(sys.argv) != 2: - print("Program requires source token as an argument, run the program as followed\npython example-project.py "); +if len(sys.argv) != 3: + print("Program requires source token and ingesting host as an argument, run the program as followed\npython example-project.py "); sys.exit(); # Create handler -handler = LogtailHandler(source_token=sys.argv[1]) +handler = LogtailHandler(source_token=sys.argv[1], host=sys.argv[2]) # Create logger logger = logging.getLogger(__name__)