https://github.com/niku/logger_stackdriver_backend
An elixir logger backend which sends logs to Stackdriver
https://github.com/niku/logger_stackdriver_backend
Last synced: 8 months ago
JSON representation
An elixir logger backend which sends logs to Stackdriver
- Host: GitHub
- URL: https://github.com/niku/logger_stackdriver_backend
- Owner: niku
- Created: 2019-08-28T17:52:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-03T22:01:22.000Z (almost 7 years ago)
- Last Synced: 2025-07-10T17:20:48.968Z (11 months ago)
- Language: Elixir
- Size: 190 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LoggerStackdriverBackend
A logger backend which sends logs to [Stackdriver](https://cloud.google.com/stackdriver/).

## Installation
```elixir
def deps do
[
{:logger_stackdriver_backend, github: "niku/logger_stackdriver_backend"}
]
end
```
## Configuration
```elixir
import Config
# First of all, add LoggerStackdriverBackend to the logger backends.
# And it needs to utc_log: true to work timestamp on Stackdriver correctly.
config :logger,
backends: [:console, LoggerStackdriverBackend],
utc_log: true
# Next, config for LoggerStackdriverBackend itself.
# Both project_id and log_name are required. It converts to "projects/#{project_id}/logs/#{log_name}" as logName on Stackdriver.
config :logger, :logger_stackdriver_backend,
project_id: "hello_world_project",
log_name: "my-first-log"
# Finally, It needs also config goth which is used by LoggerStackdriverBackend.
# You have to set up to read GCE credential json.
# You can use any setting in https://github.com/peburrows/goth#installation
config :goth,
json: "path/to/google/json/creds.json" |> File.read!
```