[#213] README: add example for disabling/removing appenders

This commit is contained in:
Peter Taoussanis 2016-12-29 18:47:14 +01:00
parent 6526637160
commit 44499d02e9
1 changed files with 12 additions and 9 deletions

View File

@ -251,6 +251,18 @@ lein uberjar # Compile jar ''
### Built-in appenders
#### Basic file appender
```clojure
;; (:require [taoensso.timbre.appenders.core :as appenders]) ; Add to ns
(timbre/merge-config!
{:appenders {:spit (appenders/spit-appender {:fname "/path/my-file.log"})}})
;; (timbre/merge-config! {:appenders {:spit {:enabled? false}}} ; To disable
;; (timbre/merge-config! {:appenders {:spit nil}} ; To remove entirely
```
#### Redis ([Carmine]) appender (v3+)
```clojure
@ -285,15 +297,6 @@ See also `car-appender/query-entries`.
{:from "me@draines.com" :to "foo@example.com"})}})
```
#### File appender
```clojure
;; (:require [taoensso.timbre.appenders.core :as appenders]) ; Add to ns
(timbre/merge-config!
{:appenders {:spit (appenders/spit-appender {:fname "/path/my-file.log"})}})
```
#### Other included appenders
A number of 3rd-party appenders are included out-the-box [here](https://github.com/ptaoussanis/timbre/tree/master/src/taoensso/timbre/appenders/3rd_party). **Please see the relevant docstring for details**. Thanks goes to the respective authors!