| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 19:45:53 GMT
X-Served-By: cache-dfw-kdal2120026-DFW, cache-bom-vanm7210074-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768679154.590372,VS0,VE302
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
Blammo-wai: Using Blammo with WAI
Blammo-wai: Using Blammo with WAI
Downloads
- Blammo-wai-0.0.0.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.0.0.0, 0.0.0.1, 0.0.0.2 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | aeson (>=1.5.2.0), base (>=4.13.0.0 && <5), Blammo (>=2.1.0.0), bytestring (>=0.10.10.1), case-insensitive (>=1.2.1.0), clock (>=0.8), http-types (>=0.12.3), monad-logger-aeson (>=0.4.0.3), text (>=1.2.4.0), unliftio-core (>=0.1.2.0), wai (>=3.2.2.1) [details] |
| License | MIT |
| Author | |
| Maintainer | Freckle Education |
| Uploaded | by PatrickBrisbin at 2024-08-01T22:40:06Z |
| Category | Logging, Web |
| Home page | https://github.com/freckle/blammo#readme |
| Bug tracker | https://github.com/freckle/blammo/issues |
| Source repo | head: git clone https://github.com/freckle/blammo |
| Distributions | |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Downloads | 231 total (6 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2024-08-01 [all 1 reports] |
Readme for Blammo-wai-0.0.0.2
[back to package description]Blammo-wai
Integration of Blammo with wai.
-- Blammo
import Blammo.Logging.Simple
-- wai
import Network.Wai (Middleware)
-- Blammo-wai
import Network.Wai.Middleware.Logging
-- warp
import qualified Network.Wai.Handler.Warp as Warp
-- yesod
import Yesod.Core (Yesod)
import qualified Yesod.Core as Yesod
data App = App
{ appLogger :: Logger
-- etc.
}
instance HasLogger App where
loggerL = lens appLogger $ \x y -> x {appLogger = y}
Integration with WAI
waiMiddleware :: App -> Middleware
waiMiddleware app =
addThreadContext ["app" .= ("my-app" :: Text)]
. requestLogger app
. Yesod.defaultMiddlewaresNoLogging
Integration with Warp
warpSettings :: App -> Warp.Settings
warpSettings app = Warp.setOnException onEx $ Warp.defaultSettings
where
onEx _req ex =
when (Warp.defaultShouldDisplayException ex)
$ runWithLogger app
$ logError
$ "Warp exception" :# ["exception" .= displayException ex]
Integration with Yesod
instance Yesod App where
messageLoggerSource app _logger loc source level msg =
runWithLogger app $ monadLoggerLog loc source level msg