remove excess log rotation; openLog rotates
This commit is contained in:
parent
0d4b513ec2
commit
7a8833c81d
1 changed files with 1 additions and 4 deletions
|
@ -103,10 +103,7 @@ checkLogSize n = do
|
||||||
totalsize <- liftIO $ sum <$> mapM filesize logs
|
totalsize <- liftIO $ sum <$> mapM filesize logs
|
||||||
when (totalsize > oneMegabyte) $ do
|
when (totalsize > oneMegabyte) $ do
|
||||||
notice ["Rotated logs due to size:", show totalsize]
|
notice ["Rotated logs due to size:", show totalsize]
|
||||||
liftIO $ do
|
liftIO $ openLog f >>= redirLog
|
||||||
rotateLog f
|
|
||||||
logfd <- openLog f
|
|
||||||
redirLog logfd
|
|
||||||
when (n < maxLogs + 1) $
|
when (n < maxLogs + 1) $
|
||||||
checkLogSize $ n + 1
|
checkLogSize $ n + 1
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue