Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevelr/service-logging
Aggregate structured logs for sending to external service; contains implementations for Coralogix and (for wasm) console.log.
https://github.com/stevelr/service-logging
cloudflare coralogix logging wasm wasm-service workers
Last synced: about 1 month ago
JSON representation
Aggregate structured logs for sending to external service; contains implementations for Coralogix and (for wasm) console.log.
- Host: GitHub
- URL: https://github.com/stevelr/service-logging
- Owner: stevelr
- License: apache-2.0
- Created: 2020-12-02T23:33:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-06T19:59:54.000Z (almost 4 years ago)
- Last Synced: 2024-11-16T22:38:29.677Z (about 2 months ago)
- Topics: cloudflare, coralogix, logging, wasm, wasm-service, workers
- Language: Rust
- Homepage:
- Size: 47.9 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Asynchronous structured logging in tiny library (6KB) with clients for Coralogix and console.log. WASM compatible.
## Usage
Use the `log!` macro to log key-value pairs, which are json-encoded
before sending to logging service```rust
use service_logging::{log, LogQueue, Severity::{Info,Error}};
let logger = CoralogixLogger::init(CoralogixConfig{
api_key: "0000",
application_name: "MyApp",
endpoint: "https://api.coralogix.com/api/v1/logs"});
let mut lq = LogQueue::default();log!(lq, Info,
method: "GET",
url: url,
status: 200
);log!(lq, Error,
user: user,
message: "Too many failed login attempts",
attempts: count
);logger.send("http", lq.take()).await?;
```