Skip to content

Commit 974a37a

Browse files
authored
Make example project work with cloud ingesting (#31)
1 parent 09d7bd7 commit 974a37a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

example-project/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ pip install logtail-python
1717
To run the example application, simply run the following command:
1818

1919
```bash
20-
python example-project.py <source-token>
20+
python example-project.py <source_token> <ingesting_host>
2121
```
2222

23-
Don't forget to replace `<source-token>` with your actual source toke which you can find in the source settings.
23+
_Don't forget to replace `<source_token>` and `<ingesting_host>` 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._
2424

2525
If you have trouble running the command above, check your Python installation and try running it with the `python3` command instead.
2626

@@ -51,7 +51,7 @@ Then we need to create a `handler`, which will be responsible for handling our l
5151

5252
```python
5353
# Create handler
54-
handler = LogtailHandler(source_token=sys.argv[1])
54+
handler = LogtailHandler(source_token=sys.argv[1], host=sys.argv[2])
5555

5656
# Create logger
5757
logger = logging.getLogger(__name__)

example-project/example-project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
import sys
1111

1212
# Check for program arguments
13-
if len(sys.argv) != 2:
14-
print("Program requires source token as an argument, run the program as followed\npython example-project.py <source-token>");
13+
if len(sys.argv) != 3:
14+
print("Program requires source token and ingesting host as an argument, run the program as followed\npython example-project.py <source_token> <ingesting_host>");
1515
sys.exit();
1616

1717
# Create handler
18-
handler = LogtailHandler(source_token=sys.argv[1])
18+
handler = LogtailHandler(source_token=sys.argv[1], host=sys.argv[2])
1919

2020
# Create logger
2121
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)