Skip to content

Instantly share code, notes, and snippets.

View ryanb93's full-sized avatar

Ryan Burke ryanb93

View GitHub Profile
@ryanb93
ryanb93 / MdcPropagatingExecutionContext.scala
Created February 1, 2019 12:28
MdcPropagatingExecutionContext
import java.util.{Map => JMap}
import com.twitter.inject.logging.MDCInitializer
import org.slf4j.MDC
import scala.concurrent.ExecutionContext
/**
* An `ExecutionContext` which takes the calling thread's MDC context map and copies it into
* the thread of where the runnable will be executed. As the `prepare` method of `ExecutionContext`
@ryanb93
ryanb93 / LogLevelFilter.scala
Created December 21, 2018 16:37
Finatra debug log per request
import com.hotels.dps.rest.filters.LogLevelFilter._
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.{Service, SimpleFilter}
import com.twitter.util.Future
import org.slf4j.MDC
object LogLevelFilter {
val LogLevelKey: String = "X-Log-Level"
}
### Keybase proof
I hereby claim:
* I am ryanb93 on github.
* I am ryanb93 (https://keybase.io/ryanb93) on keybase.
* I have a public key whose fingerprint is 0159 7AF2 4B89 92B5 D8C3 179A 98AF F462 EDAC 995B
To claim this, I am signing this object: