Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jschniper/gelf_logger
An Elixir Logger backend for GELF
https://github.com/jschniper/gelf_logger
Last synced: 3 months ago
JSON representation
An Elixir Logger backend for GELF
- Host: GitHub
- URL: https://github.com/jschniper/gelf_logger
- Owner: jschniper
- License: mit
- Created: 2016-01-29T21:52:20.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-17T15:14:38.000Z (about 4 years ago)
- Last Synced: 2024-09-27T05:56:18.144Z (4 months ago)
- Language: Elixir
- Homepage:
- Size: 49.8 KB
- Stars: 29
- Watchers: 4
- Forks: 27
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A Logger backend that will generate Graylog Extended Log Format (GELF) messages. (Logging)
- fucking-awesome-elixir - gelf_logger - A Logger backend that will generate Graylog Extended Log Format (GELF) messages. (Logging)
- awesome-elixir - gelf_logger - A Logger backend that will generate Graylog Extended Log Format (GELF) messages. (Logging)
README
# GelfLogger [![Build Status](https://travis-ci.org/jschniper/gelf_logger.svg?branch=master)](https://travis-ci.org/jschniper/gelf_logger)
A logger backend that will generate Graylog Extended Log Format messages. The
current version only supports UDP messages.## Configuration
In the config.exs, add gelf_logger as a backend like this:
```elixir
config :logger,
backends: [:console, {Logger.Backends.Gelf, :gelf_logger}]
```In addition, you'll need to pass in some configuration items to the backend
itself:```elixir
config :logger, :gelf_logger,
host: "127.0.0.1",
port: 12201,
format: "$message",
application: "myapp",
compression: :gzip, # Defaults to :gzip, also accepts :zlib or :raw
metadata: [:request_id, :function, :module, :file, :line],
hostname: "hostname-override",
format: {Module, :function} # or format: "[$level] $message"
tags: [
list: "of",
extra: "tags"
]
```In addition to the backend configuration, you might want to check the
[Logger configuration](https://hexdocs.pm/logger/Logger.html) for other
options that might be important for your particular environment. In
particular, modifying the `:utc_log` setting might be necessary
depending on your server configuration.
This backend supports `metadata: :all`.## Usage
Just use Logger as normal.
## Improvements
- [x] Tests
- [ ] TCP Support
- [x] Options for compression (none, zlib)
- [x] Send timestamp instead of relying on the Graylog server to set it
- [x] Find a better way of pulling the hostnameAnd probably many more. This is only out here because it might be useful to
someone in its current state. Pull requests are always welcome.## Notes
Credit where credit is due, this would not exist without
[protofy/erl_graylog_sender](https://github.com/protofy/erl_graylog_sender).Looking for maintainers if anyone would like to help!