@@ -75,7 +75,7 @@ import Pos.DB.Rocks (NodeDBs, closeNodeDBs, dbDeleteDefault,
7575 dbWriteBatchDefault , openNodeDBs )
7676import Pos.DB.Update (affirmUpdateInstalled )
7777import Pos.Infra.Reporting.Http (sendReport )
78- import Pos.Infra.Reporting.Wlog (compressLogs , retrieveLogFiles )
78+ import Pos.Infra.Reporting.Wlog (compressLogs )
7979import Pos.Launcher (HasConfigurations , withConfigurations )
8080import Pos.Launcher.Configuration (ConfigurationOptions (.. ))
8181import Pos.Network.Update.Download (installerHash )
@@ -84,11 +84,13 @@ import Pos.Util (HasLens (..), directory, logException,
8484 postfixLFields )
8585import Pos.Util.CompileInfo (HasCompileInfo , compileInfo ,
8686 withCompileInfo )
87- import Pos.Util.Log.LoggerConfig (defaultInteractiveConfiguration ,
87+ import Pos.Util.Log.LoggerConfig (BackendKind (.. ), LogHandler (.. ),
88+ LogSecurityLevel (.. ), defaultInteractiveConfiguration ,
89+ lcBasePath , lcLoggerTree , ltHandlers , ltMinSeverity ,
8890 retrieveLogFiles )
89- import Pos.Util.Wlog (LoggerNameBox (.. ), Severity (Debug ) ,
90- lcBasePath , lcLoggerTree , logError , logInfo , logNotice ,
91- logWarning , usingLoggerName )
91+ import Pos.Util.Wlog (LoggerNameBox (.. ), Severity (Info ), logError ,
92+ logInfo , logNotice , logWarning , setupLogging ,
93+ usingLoggerName )
9294
9395import Pos.Tools.Launcher.Environment (substituteEnvVarsValue )
9496import Pos.Tools.Launcher.Logging (reportErrorDefault )
@@ -299,18 +301,22 @@ main =
299301 case loNodeLogConfig of
300302 Nothing -> loNodeArgs
301303 Just lc -> loNodeArgs ++ [" --log-config" , toText lc]
302- setupLogging Nothing $
303- defaultInteractiveConfiguration Debug
304+ setupLogging $
305+ defaultInteractiveConfiguration Info
304306 & lcBasePath .~ launcherLogsPrefix
305307 & lcLoggerTree %~ case launcherLogsPrefix of
306308 Nothing ->
307309 identity
308310 Just _ ->
309- (ltHandlers %~ (\ xs -> LogHandler { _lhName= " node" , _lhFpath= Just " node.log"
310- , _lhBackend= FileTextBE
311- , _lhMinSeverity= Just Debug
312- , _lhSecurityLevel= Just PublicLogLevel } : xs)) .
313- set ltMinSeverity Debug
311+ (ltHandlers %~ (\ xs -> [LogHandler { _lhName= " node" , _lhFpath= Just " node.log"
312+ , _lhBackend= FileTextBE
313+ , _lhMinSeverity= Just Info
314+ , _lhSecurityLevel= Just SecretLogLevel }
315+ ,LogHandler { _lhName= " json" , _lhFpath= Just " pub/node.pub"
316+ , _lhBackend= FileJsonBE
317+ , _lhMinSeverity= Just Info
318+ , _lhSecurityLevel= Just PublicLogLevel }] ++ xs)) .
319+ set ltMinSeverity Info
314320 logException loggerName . usingLoggerName loggerName $
315321 withConfigurations Nothing loConfiguration $ \ coreConfig _ _ -> do
316322
@@ -721,6 +727,7 @@ reportNodeCrash
721727 -> M ()
722728reportNodeCrash pm exitCode _ logConfPath reportServ = do
723729 logConfig <- readLoggerConfig (toString <$> logConfPath)
730+ -- TODO this should be moved where we have access to logfiles
724731 let logFileNames =
725732 map ((fromMaybe " " (logConfig ^. lcBasePath) </> ) . snd ) $
726733 retrieveLogFiles logConfig
0 commit comments