Logging is hard in a server-less environment. The sls logs
command is one of the ways Serverless is trying to make it easier for developers. sls local
is one of the other ways the framework is making it easier to get feedback quickly, but is relatively recent functionality in the grand scheme of things. Logging is definitely a problem-space with lots of room for improvement.
The SLS_DEBUG
environment parameter is for debugging the Serverless Framework, not your functions (which are deployed by Serverless, but not actually running the Serverless code). You use it when you run the serverless
(or sls
, which is just an alias to serverless
) command e.g. sls deploy ...
, etc. It doesn’t have any impact in your function, unless you specifically add it.
Nice work sharing your experiences! I think it’s something we all go through, we just try to forget about it…