@@ -6,7 +6,6 @@ module Control.Logger.Katip
66 , KatipContextTState(..)
77 , getKatipLogger
88 , ourFormatter
9− , ourMapping
109 , katipIndexNameString
1110 , reopenableFileLog
1211 ) where
@@ -18,15 +17,12 @@ import Control.Logger.Internal
1817import Control.Logger.Katip.Scribes.Reopenable
1918import Data.Aeson hiding (Error)
2019import qualified Data.HashMap.Strict as HM
21−import Data.Proxy as P
2220import Data.Text (Text)
2321import qualified Data.Text as T
2422import qualified Data.Text.Lazy.Builder as T.Builder
2523import Katip as K hiding (logMsg)
2624import Katip.Core (ItemFunc(..), LocJs(..), ProcessIDJs(..))
2725import Katip.Monadic (KatipContextTState(..))
28−import Katip.Scribes.ElasticSearch
29−import Katip.Scribes.ElasticSearch.Internal as K
3026
3127
3228logSeverityToKSeverity :: LogSeverity -> Severity
@@ -55,41 +51,6 @@ ourFormatter gitRev verb = ItemFunc $ \item -> go $ ourItemJson verb item
5551 setRev :: HM.HashMap Text Value -> HM.HashMap Text Value
5652 setRev = HM.insert "rev-hash" (toJSON gitRev)
5753
58−ourMapping :: K.MappingName ESV5 -> Value
59−ourMapping mn = object
60− [fromMappingName prx mn .= object ["properties" .= object prs]]
61− where
62− prs =
63− [ unanalyzedString "thread"
64− , unanalyzedString "sev"
65− , unanalyzedString "pid"
66− -- ns is frequently fulltext searched
67− , analyzedString "ns"
68− -- we want message to be fulltext searchable
69− , analyzedString "msg"
70− -- we want to group by the message as well
71− , unanalyzedString "msg-keyword"
72− -- we want to group by revision hash
73− , unanalyzedString "rev-hash"
74− , "loc" .= locType
75− , unanalyzedString "host"
76− , unanalyzedString "env"
77− , "at" .= dateType
78− , unanalyzedString "app"
79− ]
80− prx = P.Proxy :: P.Proxy ESV5
81− unanalyzedString k = k .= unanalyzedStringSpec prx
82− analyzedString k = k .= analyzedStringSpec prx
83− locType = object ["properties" .= object locPairs]
84− locPairs =
85− [ unanalyzedString "loc_pkg"
86− , unanalyzedString "loc_mod"
87− , unanalyzedString "loc_ln"
88− , unanalyzedString "loc_fn"
89− , unanalyzedString "loc_col"
90− ]
91− dateType = object ["format" .= esDateFormat, "type" .= String "date"]
92−
9354katipIndexNameString :: Text
9455katipIndexNameString = "antorica-b2b-logs"
9556