Recall & Review
beginner
What is Winston in the context of Express applications?
Winston is a logging library for Node.js and Express apps. It helps record messages about app activity, errors, and other events in a simple and organized way.
Click to reveal answer
beginner
How do you create a basic Winston logger?
You create a Winston logger by importing winston and calling winston.createLogger() with options like log level and transports (where logs go).
Click to reveal answer
beginner
What is a transport in Winston?
A transport is a storage or output for logs, like the console or a file. Winston can send logs to many transports at once.
Click to reveal answer
beginner
Why use different log levels in Winston?
Log levels help organize messages by importance, like 'error' for problems and 'info' for normal messages. This helps find issues faster.
Click to reveal answer
beginner
How can Winston improve debugging in Express apps?
Winston records detailed logs about app events and errors. This helps developers see what happened and fix problems quickly.
Click to reveal answer
What is the main purpose of Winston in an Express app?
✗ Incorrect
Winston is used to log events and errors, helping track app behavior.
Which of these is a Winston transport?
✗ Incorrect
Console is a transport that outputs logs to the terminal.
How do you set the log level in Winston?
✗ Incorrect
The 'level' option in createLogger defines the minimum log level to record.
What log level should you use for unexpected errors?
✗ Incorrect
'error' level is used for serious problems that need attention.
Can Winston send logs to multiple places at once?
✗ Incorrect
Winston supports multiple transports to send logs to different outputs simultaneously.
Explain how to set up Winston for logging in an Express application.
Think about how you tell Winston where to send logs and what to record.
You got /4 concepts.
Describe the benefits of using different log levels in Winston.
Consider how sorting messages helps when you have many logs.
You got /4 concepts.