delayer-aws

Simplistic cloud-native distributed scheduler, serverlessly built on top of AWS services

View the Project on GitHub trestini/delayer-aws

Use of a logging framework

Context and Problem Statement

Use of a logging mechanism other than javascript’s console.log should provide more feature in logging.

Decision Drivers

Considered Options

Decision Outcome

Chosen option as for “wrapped console.log calls”. Since console.log is just a simple way to log things, it doesn’t meant for more advanced logging purposes. winston came to fill this gap with a complete logging solution for nodejs applications. However, in the scope of a lambda function, specially in a AWS environment, the major part of those features will not be used (for example the transports, coloring, advanced templating).

In this sense, wrap a console.log with some basic features like leveling, and basic templating can fit better to current context. Only for the sake of futurism, the wrapper must be implemented following the same interface of winston (eg: logger.info(...), logger.error(...), etc).

Pros and Cons of the Options

Simple console.log calls

Wrapped console.log calls

winston framework