Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions example-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pip install logtail-python
To run the example application, simply run the following command:

```bash
python example-project.py <source-token>
python example-project.py <source_token> <ingesting_host>
```

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

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

Expand Down Expand Up @@ -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__)
Expand Down
6 changes: 3 additions & 3 deletions example-project/example-project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <source-token>");
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 <source_token> <ingesting_host>");
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__)
Expand Down