Skip to content

Commit 9a76381

Browse files
authored
Make example project work with cloud ingesting (#31)
1 parent 4811f3a commit 9a76381

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

example-project/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ This will install all dependencies listed in the `Gemfile.lock` file.
1515
Alternatively, add `gem "logtail"` to your `Gemfile` manually and then run `bundle install`.
1616

1717
## Run the example project
18-
19-
Replace `<source-token>` with your actual source token in the `main.rb` file. You can find your source token by going to _logtail.com -> sources -> edit_.
20-
18+
19+
_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._
20+
2121
To run the example application, run the following command adding your source token:
2222

2323
```bash
24-
bundle exec ruby main.rb <source-token>
24+
bundle exec ruby main.rb <source_token> <ingesting_host>
2525
```
2626

2727
This will create a total of 5 different logs, each corresponding to a different log level. You can review these logs in Logtail.

example-project/main.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
require "logtail"
88

99
# Check for program arguments
10-
if ARGV.length != 1
11-
puts "Program needs source token to run. Run the program as followed\nbundle exec ruby main.rb <source-token>"
10+
if ARGV.length != 2
11+
puts "Program needs source token and ingesting host to run. Run the program as followed\nbundle exec ruby main.rb <source_token> <ingesting_host>"
1212
exit
1313
end
1414
# Create logger
15-
http_device = Logtail::LogDevices::HTTP.new(ARGV[0])
15+
http_device = Logtail::LogDevices::HTTP.new(ARGV[0], logtail_host: ARGV[1])
1616
logger = Logtail::Logger.new(http_device)
1717

1818
# Filter logs that shouldn't be sent to Better Stack, see {Logtail::LogEntry} for available attributes

0 commit comments

Comments
 (0)