File logging in cloud Haskell using monad-logger

169 Views Asked by At

I am trying to log into a file from inside Cloud Haskell's processes. In order to do so I have been using the monad-logger library which exposes runFileLoggingT. The code I'm using looks like:

mainProcess :: Process ProcessId
mainProcess = spawnLocal $ runFileLoggingT "log/application.log" $ return ()

But I'm getting an error:

Could not deduce (Control.Monad.Trans.Control.MonadBaseControl IO Process)

That is because runFileLoggingT has to work on a monad that implements MonadBaseControl, which is not the case for Process. Being a beginner on monad transformers I don't know how to implement the instance myself.

What do I need to do in order to make it work?

0

There are 0 best solutions below