log-influx_backend
Version, currently master branch1 version
- master branchlatestNov 19, 2021
github.com/dscottboggs/crystal-log-influx_backend
InfluxDB implementation of Crystal's Log::Backend
Installation
# Add this to your shard.yml
dependencies:
log-influx_backend:
github: dscottboggs/crystal-log-influx_backend
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.2.1- License
- MIT
- Author
- D. Scott Boggs
Dependencies
This version declares no dependencies.
README
InfluxDB backend for Crystal's Logger
The Crystal standard library contains a configurable logging mechanism. This allows that to be output to InfluxDB.
Installation
-
Add the dependency to your
shard.yml:dependencies: log-influx_backend: github: dscottboggs/crystal-log-influx_backend -
Run
shards install
Usage
require "log"
require "log-influx_backend"
Log.setup backend: Log::InfluxBackend.new token: "your config token",
org: "your organization",
bucket: "some bucket"
Log.info &.emit "a log message!", cpu_count: System.cpu_count
The log entry's severity, context, and source are formatted as "tags", while the log message and any metadata are logged as fields.
Development
Running tests
Before the integration test will run, you need to write a config file in the project directory.
cat <<-YAML > spec-config.yml
token: (your API token goes here -- found in /etc/influxdb2/influx-configs wherever the influx service is running)
org: some-org
bucket: log-influx_backend.spec
YAML
Contributing
- Fork it (https://github.com/dscottboggs/log-influx_backend/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- D. Scott Boggs - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Nov 19, 2021
- Crystal
1.2.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dscottboggs/crystal-log-influx_backend
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1