Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tank-bohr/lager_scribe_backend
Lager backend for facebook's scribe
https://github.com/tank-bohr/lager_scribe_backend
Last synced: about 2 months ago
JSON representation
Lager backend for facebook's scribe
- Host: GitHub
- URL: https://github.com/tank-bohr/lager_scribe_backend
- Owner: tank-bohr
- License: mit
- Created: 2014-03-27T15:38:36.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-29T07:35:11.000Z (over 8 years ago)
- Last Synced: 2024-10-21T18:35:48.408Z (3 months ago)
- Language: Erlang
- Homepage:
- Size: 352 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Lager Scribe backend
====================Lager backend for [facebook's scribe](https://github.com/facebook/scribe). This is a backend for the [Lager Erlang logging framework](https://github.com/basho/lager).
### Configuration
You can pass the backend the following configuration (shown are the defaults):
```erlang
{lager, [
{handlers, [
{lager_scribe_backend, [
{level, debug},
{formatter, lager_default_formatter},
{formatter_config, []},
{category, undefined}
{scribe_host, "localhost"},
{scribe_port, 1463},
{pool_size, [{size, 5}, {max_overflow, 10}]}
]}
]}
]}
```### Scribe log entry category
To define custom scribe category for message one should implement own `category` module like this
```erlang
-module(myapp_lagger_scribe_category).-behaviour(lager_scribe_category).
-export([category/1]).category(Message) ->
Severity = lager_msg:severity(Message),
log_category(Severity).log_category(error) -> "myapp-error";
log_category(_) -> "myapp-info".
```by defalt category would be `lager.`
### Poolboy integration
`lager_scribe_backend` uses process pool to send log messages to scribe. You can tune pool size in handler config. To know more about `max_overflow` option see [poolboy documentation](https://github.com/devinus/poolboy/blob/master/README.md#options)